/* ============================================================================
   TOP COOKIES - SHOP PAGE STYLES
   Clean production-ready CSS with all improvements included
   Mobile-first RTL design for Hebrew
   ============================================================================ */

/* ========== CSS VARIABLES ========== */

:root {
  /* Brand Colors - Orange Theme */
  --primary: #d97706;
  --primary-dark: #92400e;
  --primary-foreground: #ffffff;

  /* Background & Surface */
  --background: #fffbf5;
  --foreground: #451a03;
  --card: #ffffff;
  --card-foreground: #451a03;

  /* Text Colors */
  --text: #451a03;
  --muted: #e7e5e4;
  --muted-foreground: #78716c;

  /* Semantic Colors */
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --success: #10b981;
  --error: #ef4444;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  /* Focus & Interaction */
  --ring: rgba(217, 119, 6, 0.5);
  --accent: #fef3c7;
  --accent-foreground: #451a03;

  /* Radius System */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 0.25rem);
  --radius-md: calc(var(--radius) - 0.125rem);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 0.25rem);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Accessibility */
  --a11y-scale: 1;

  /* Fluid Spacing Scale */
  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 0.75rem);
  --space-md: clamp(0.75rem, 1.5vw, 1rem);
  --space-lg: clamp(1rem, 2vw, 1.5rem);
  --space-xl: clamp(1.5rem, 3vw, 2rem);
  --space-2xl: clamp(2rem, 4vw, 3rem);
}

/* ========== BASE STYLES ========== */

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  direction: rtl;
  position: relative;
  /* Fluid base font size */
  font-size: clamp(14px, 1.5vw, 16px);
}

body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  font-size: 1rem; /* Scales with html */
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6.25rem;
  position: relative;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* ========== SCROLLBAR STYLING ========== */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.3) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.3);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 119, 6, 0.5);
  background-clip: padding-box;
}

/* Hide scrollbar on mobile */
@media (max-width: 767px) {
  *::-webkit-scrollbar {
    display: none;
  }
  * {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* ========== CONTAINER ========== */

.container {
  width: 100%;
  max-width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2vw, 2rem);
  position: relative;
}

/* ========== HEADER ========== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .header .container {
    gap: var(--space-sm);
  }

  .header .container > div {
    flex-wrap: wrap;
    gap: var(--space-xs) !important;
  }
}

.logo {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Mode Switcher */
.mode-switcher {
  padding: var(--space-sm) var(--space-lg);
  background: var(--primary);
  color: white;
  border-radius: 1.25rem;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mode-switcher:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .mode-switcher {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 36px;
    gap: 4px;
  }
}

/* ========== HERO SECTION ========== */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 48px 20px;
  margin: 20px 12px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(217, 119, 6, 0.25);
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.hero h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  margin: 0 0 var(--space-lg) 0;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 0 0 var(--space-xl) 0;
  opacity: 0.95;
  line-height: 1.6;
}

.cta-btn {
  padding: 14px 36px;
  background: white;
  color: var(--primary);
  border-radius: 28px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: none;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  background: #fffbf5;
}

/* ========== CONTROLS (Search & Sort) ========== */

.controls {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  flex-wrap: wrap;
}

.search-input,
.sort-select {
  padding: var(--space-md) var(--space-lg);
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: var(--font-weight-normal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--input-background);
  font-family: inherit;
  color: var(--foreground);
  min-height: 2.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.search-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.8;
}

.search-input:hover,
.sort-select:hover {
  border-color: rgba(217, 119, 6, 0.3);
}

.search-input:focus,
.sort-select:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.sort-select {
  min-width: 150px;
  cursor: pointer;
}

/* ========== CATEGORY TABS ========== */

.categories {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 2.75rem;
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  border-color: var(--primary);
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.category-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-tab.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* ========== PRODUCTS SECTION ========== */

main h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin: var(--space-xl) 0 var(--space-sm) 0;
  color: var(--text);
}

main .subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--muted);
  margin: 0 0 var(--space-xl) 0;
}

/* ========== PRODUCTS GRID ========== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-xl);
  padding: 0;
  margin-bottom: var(--space-2xl);
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
    gap: var(--space-lg);
  }
}

/* ========== PRODUCT CARD ========== */

.product-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(217, 119, 6, 0.2);
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  overflow: hidden;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
}

.product-body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
}

.product-title {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 700;
  line-height: 1.4;
  flex: 1;
  color: var(--text);
  letter-spacing: -0.01em;
}

.product-price {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 900;
  color: #b45309; /* Darker orange for better contrast */
  white-space: nowrap;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.product-price-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0;
}

.product-description {
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
  min-height: 100px; /* Reserve space for buttons to prevent layout shift */
}

/* ========== BUTTONS ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  min-height: 2.75rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: inherit;
  outline: none;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-lg);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--ring);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== QUANTITY CONTROLS ========== */

.qty-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  padding: 0;
}

.qty-controls:hover {
  box-shadow: var(--shadow);
  border-color: rgba(217, 119, 6, 0.3);
}

.qty-btn {
  background: transparent;
  border: none;
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--foreground);
  transition: all 0.2s;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--accent);
  color: var(--primary);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-input {
  border: none;
  width: 50px;
  min-width: 50px;
  text-align: center;
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  padding: 0 4px;
  background: transparent;
  color: var(--foreground);
  -moz-appearance: textfield;
  flex-shrink: 0;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ========== CART BUTTON (FAB) ========== */

.cart-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: calc(100% - 32px);
}

.cart-btn:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 12px 32px rgba(217, 119, 6, 0.4), 0 6px 16px rgba(0,0,0,0.15);
  background: var(--primary-dark);
}

.cart-btn:active {
  transform: translateX(-50%) scale(1.02);
}

#cartCount {
  background: var(--card);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: var(--font-weight-extrabold);
  min-width: 28px;
  text-align: center;
}

/* ========== ACCESSIBILITY WIDGET (Now in Header) ========== */

.a11y-widget {
  display: none !important; /* Hide old floating widget */
}

.a11y-panel {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.a11y-option {
  padding: 10px;
  font-size: 13px;
  min-height: 40px;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
}

.a11y-option:hover {
  background: var(--background);
  border-color: var(--primary);
}

/* ========== TOAST NOTIFICATIONS ========== */

.toast {
  position: fixed;
  top: 80px;
  right: 16px;
  background: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  max-width: 300px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
  opacity: 0.95;
}

/* ========== SCREEN READER ONLY ========== */

.sr-only,
#live-region {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ========== RESPONSIVE - TABLET ========== */

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .products-grid {
    gap: 24px;
  }

  .hero {
    padding: 60px 32px;
    margin: 24px;
  }

  .hero h2 {
    font-size: 40px;
  }

  .hero p {
    font-size: 20px;
  }

  .cart-btn {
    left: auto;
    right: 24px;
    transform: none;
  }

  .cart-btn:hover {
    transform: scale(1.05);
  }

  .a11y-widget {
    left: auto;
    right: 24px;
  }

  .a11y-panel {
    left: auto;
    right: 24px;
  }

  .product-body {
    padding: 20px;
  }

  .product-title {
    font-size: 17px;
  }

  .product-price {
    font-size: 19px;
  }
}

/* ========== RESPONSIVE - DESKTOP ========== */

@media (min-width: 1024px) {
  .container {
    padding: 0 32px;
  }

  .products-grid {
    gap: 28px;
  }

  .hero {
    padding: 72px 40px;
  }

  .hero h2 {
    font-size: 48px;
  }

  .cart-btn {
    bottom: 28px;
    right: 28px;
  }

  .a11y-widget {
    bottom: 28px;
    right: auto;
    left: 28px;
  }

  .a11y-panel {
    bottom: 82px;
    left: 28px;
    right: auto;
  }
}

/* ========== RESPONSIVE - LARGE DESKTOP ========== */

@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .products-grid {
    gap: 32px;
  }

  .hero {
    padding: 80px 48px;
    margin: 32px auto;
    max-width: 1280px;
  }
}

/* ========== MOBILE - SMALL SCREENS ========== */

@media (max-width: 360px) {
  .logo {
    font-size: 20px;
  }

  .mode-switcher {
    font-size: 12px;
    padding: 6px 12px;
  }

  .hero h2 {
    font-size: 22px;
  }

  .products-grid {
    gap: 12px;
  }

  .product-body {
    padding: 10px;
  }

  .product-title {
    font-size: 13px;
  }

  .product-price {
    font-size: 14px;
  }

  .cart-btn {
    font-size: 14px;
    padding: 12px 20px;
  }
}

/* ========== iOS SAFE AREA ========== */

@supports (padding: max(0px)) {
  body {
    padding-bottom: max(100px, calc(100px + env(safe-area-inset-bottom)));
  }

  .cart-btn {
    bottom: max(20px, calc(20px + env(safe-area-inset-bottom)));
  }

  .a11y-widget {
    bottom: max(20px, calc(20px + env(safe-area-inset-bottom)));
  }

  .a11y-panel {
    bottom: max(70px, calc(70px + env(safe-area-inset-bottom)));
  }
}

/* ========== PRINT STYLES ========== */

@media print {
  .cart-btn,
  .a11y-widget,
  .toast,
  .mode-switcher {
    display: none !important;
  }

  .product-card {
    break-inside: avoid;
  }
}

/* ========== LOADING STATE ========== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(251, 146, 60, 0);
  }
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

/* ========== CART DRAWER (Figma-Style Sheet) ========== */

.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  pointer-events: none;
}

.cart-drawer.open {
  display: block;
  pointer-events: auto;
}

.cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open .cart-overlay {
  opacity: 1;
}

.cart-sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: auto;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open .cart-sheet {
  transform: translateX(0);
}

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  flex-shrink: 0;
}

.cart-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: var(--foreground);
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cart-close-btn:hover {
  background: var(--accent);
  border-color: var(--primary);
}

.cart-body {
  flex: 0 1 auto;
  overflow-y: auto;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 200px);
}

.cart-items {
  margin-bottom: 16px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-title {
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--foreground);
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
  color: var(--muted-foreground);
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--background);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.cart-item:hover {
  background: var(--accent);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: var(--font-weight-semibold);
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--foreground);
}

.cart-item-price {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Quantity controls in cart */
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.cart-qty-controls:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.cart-qty-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  background: var(--accent);
  color: var(--foreground);
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cart-qty-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.cart-qty-btn:active {
  transform: scale(0.95);
}

.cart-qty-display {
  min-width: 32px;
  text-align: center;
  font-weight: var(--font-weight-bold);
  font-size: 16px;
  color: var(--foreground);
}

.cart-item-total {
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  color: var(--primary);
  white-space: nowrap;
}

/* Old styles - keeping for compatibility */
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
}

.cart-item-qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.cart-item-qty-btn:hover {
  background: var(--accent);
  color: var(--primary);
}

.cart-item-qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: var(--font-weight-semibold);
  font-size: 14px;
}

.cart-item-remove {
  padding: 4px 12px;
  font-size: 12px;
  min-height: 32px;
}

.checkout-form {
  margin-top: 16px;
}

.form-section {
  margin-bottom: 16px;
}

.form-section h3 {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  margin: 0 0 16px 0;
  color: var(--foreground);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 6px;
  color: var(--foreground);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--input-background);
  font-size: 16px;
  font-family: inherit;
  color: var(--foreground);
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.cart-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.total-row strong {
  font-weight: var(--font-weight-bold);
  color: var(--foreground);
}

.total-grand {
  font-size: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.total-grand strong {
  font-size: 20px;
  color: var(--primary);
}

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.btn-secondary {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--muted);
}

.btn-secondary:hover {
  background: var(--muted-foreground);
}

.btn-cart-goto {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  border: none !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-cart-goto:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-cart-goto:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  border-color: #25D366;
}

.btn-whatsapp:hover {
  background: #20BA5A;
  border-color: #20BA5A;
}

.btn-instagram {
  background: linear-gradient(135deg, #E4405F, #C13584);
  color: white;
  border: none;
}

.btn-instagram:hover {
  background: linear-gradient(135deg, #D13654, #AD2D75);
}

@media (max-width: 767px) {
  /* Force cart drawer to be completely hidden when closed */
  .cart-drawer:not(.open) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Ensure full width when cart is open */
  .cart-drawer.open {
    position: fixed !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .cart-sheet {
    max-width: 100% !important;
    width: 100% !important;
  }

  .cart-header {
    padding: 16px 20px;
  }

  .cart-body {
    padding: 20px;
  }

  .cart-footer {
    padding: 16px 20px;
  }

  /* Larger touch targets for mobile */
  .cart-qty-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 22px;
  }

  .cart-qty-controls {
    padding: 10px 14px;
    gap: 14px;
  }

  .cart-qty-display {
    min-width: 36px;
    font-size: 18px;
  }

  /* Ensure main content uses full width */
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .container, main, .products-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Single column grid for products */
  .products-grid {
    grid-template-columns: 1fr !important;
  }
}
