:root {
  /* Brand Colors - Logo Red Theme */
  --brand-50: #fff0f0;
  --brand-100: #ffdddd;
  --brand-200: #ffc0c0;
  --brand-300: #ff9494;
  --brand-400: #ff5757;
  --brand-500: #e30001;
  --brand-600: #cc0001;
  --brand-700: #b30001;
  --brand-800: #930001;
  --brand-900: #7a0001;
  --brand-950: #4d0000;
  
  /* Gradient Definitions */
  --gradient-brand: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  --gradient-premium: linear-gradient(135deg, #1f2937, #374151);
  --gradient-success: linear-gradient(135deg, #059669, #047857);
  
  /* Shadows */
  --shadow-soft: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-brand: 0 10px 25px rgba(235, 107, 26, 0.15);
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background-color: #fafafa;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === ANIMATIONS === */
@keyframes pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Animation Classes */
.animate-pop {
  animation: pop var(--transition-fast) ease-in-out;
}

.animate-slide-in {
  animation: slideIn var(--transition-normal) ease-out;
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) ease-out;
}

.animate-bounce-subtle {
  animation: bounce 2s infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* === SCROLLBARS === */
.horizontal-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-500) #f1f5f9;
  scroll-snap-type: x mandatory;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 4px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  border-radius: 2px;
}

.horizontal-scroll > * {
  scroll-snap-align: start;
}

/* Promo Swiper Styling */
.promo-swiper .swiper-slide {
  width: 280px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .promo-swiper .swiper-slide {
    width: 260px;
  }
}

/* Promo card sizing */
.promo-card {
  width: 100%;
  min-width: 0;
}

.product-card {
  min-width: 0;
}

/* Custom navigation buttons */
.promo-swiper-button-prev,
.promo-swiper-button-next {
  cursor: pointer;
}

.promo-swiper-button-prev:hover,
.promo-swiper-button-next:hover {
  transform: scale(1.05);
}

/* Hide navigation on mobile */
@media (max-width: 768px) {
  .promo-swiper-button-prev,
  .promo-swiper-button-next {
    display: none;
  }
}

/* === SWIPER CUSTOMIZATION === */
.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5) !important;
  opacity: 1 !important;
  margin: 0 6px !important;
}

.swiper-pagination-bullet-active {
  background: #ffffff !important;
  transform: scale(1.2);
}

.swiper-button-next, 
.swiper-button-prev {
  color: rgba(255, 255, 255, 0.8) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
}

.swiper-button-next:hover, 
.swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #ffffff !important;
}

/* === MODAL TRANSITIONS === */
#cart-modal {
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

#cart-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#cart-modal-content {
  transition: all var(--transition-normal);
  transform-origin: bottom;
}

#cart-modal-content.hidden {
  transform: translateY(100%) scale(0.95);
  opacity: 0;
}

/* === QUANTITY SELECTORS === */
.quantity-selector-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  color: white;
  height: 2.75rem;
  flex: 1;
  box-shadow: var(--shadow-medium);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.quantity-selector-grid:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-large);
}

.quantity-selector-slide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  background-color: white;
  color: var(--brand-600);
  height: 2.75rem;
  min-width: 160px;
  padding: 0 1rem;
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-fast);
}

.quantity-selector-slide:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-medium);
}

/* Quantity Selector Buttons */
.quantity-selector-btn {
  height: 2.25rem;
  width: 2.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 50%;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.quantity-selector-btn:active {
  transform: scale(0.9);
}

.quantity-selector-btn-minus {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.quantity-selector-btn-minus:hover {
  color: white;
  background: rgba(220, 38, 38, 0.8);
}

.quantity-selector-slide .quantity-selector-btn-minus {
  color: #94a3b8;
  background: #f1f5f9;
}

.quantity-selector-slide .quantity-selector-btn-minus:hover {
  color: #dc2626;
  background: #fee2e2;
}

.quantity-selector-btn-plus {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

.quantity-selector-btn-plus:hover {
  background: rgba(34, 197, 94, 0.9);
}

.quantity-selector-slide .quantity-selector-btn-plus {
  color: #059669;
  background: #dcfce7;
}

.quantity-selector-slide .quantity-selector-btn-plus:hover {
  background: #bbf7d0;
}

.quantity-selector-value {
  width: 2.5rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 800;
  margin: 0 0.5rem;
}

.quantity-selector-slide .quantity-selector-value {
  color: #1f2937;
}

/* === CATEGORY BUTTONS === */
.cat-btn.active,
.cat-btn[aria-selected="true"] {
  background: var(--gradient-brand) !important;
  border-color: var(--brand-500) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

.quick-cat-btn.active {
  border-color: var(--brand-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

/* === UTILITY CLASSES === */
.glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hover-lift {
  transition: transform var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.thumb-friendly {
  min-height: 44px;
  min-width: 44px;
}

.mobile-optimized {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* === RESPONSIVE IMPROVEMENTS === */
@media (max-width: 640px) {
  .quantity-selector-slide {
    min-width: 120px;
    padding: 0 0.5rem;
    height: 2.5rem;
  }
  
  .quantity-selector-grid {
    height: 2.5rem;
  }
  
  .quantity-selector-btn {
    height: 1.75rem;
    width: 1.75rem;
    font-size: 0.875rem;
  }
  
  .quantity-selector-value {
    width: 1.5rem;
    font-size: 0.75rem;
    margin: 0 0.25rem;
  }
  
  /* Mobile button styles */
  .mobile-add-btn {
    width: 100%;
    height: 44px;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
  }
  
  .mobile-card {
    padding: 1rem;
  }
  
  .mobile-card h3 {
    font-size: 1rem;
    line-height: 1.25rem;
  }
  
  /* Very small screens optimizations */
  .swiper-slide {
    padding: 0;
  }
  
  /* Banner minimum height for mobile */
  .swiper-slide > div {
    min-height: 25rem;
  }
  
  /* Quick action buttons optimization */
  .quick-cat-btn {
    padding: 0.75rem 0.5rem;
  }
  
  .quick-cat-btn span {
    font-size: 0.65rem;
    line-height: 1;
  }
  
  /* Ensure card buttons are visible */
  .card-button-container {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
}

/* === EXTRA SMALL SCREENS === */
@media (max-width: 375px) {
  /* Even smaller padding for very small screens */
  .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Optimize cart modal for small screens */
  #cart-modal-content {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
  
  /* Smaller banner padding */
  .swiper-slide .p-6 {
    padding: 1rem;
  }
  
  /* Quick actions with better text fitting */
  .quick-cat-btn {
    padding: 0.5rem 0.25rem;
  }
  
  .quick-cat-btn .w-12 {
    width: 2.5rem;
    height: 2.5rem;
  }
}