/* ========================================
   iamNK PhotoKiosk - Public Catalogue
   Modern, stylish public-facing catalogue
   ======================================== */

/* CSS Custom Properties */
:root {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-light: #fff7ed;
  --primary-dark: #9a3412;

  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #ecfeff;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.14);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition-fast: 150ms ease;
  --transition: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --header-height: 72px;
  --category-nav-height: 52px;
  --cart-sidebar-width: 420px;
}

/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ─── Floating announcement bar ───────────────── */
@keyframes announcement-slide {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ─── Watermark ────────────────────────────────── */
.watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 800;
  color: rgba(0, 0, 0, 0.018);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  letter-spacing: -0.02em;
}

/* ─── Header ───────────────────────────────────── */
.catalogue-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 2rem;
  line-height: 1;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Search Bar */
.search-bar {
  position: relative;
  width: 320px;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 42px;
  padding: 0 2.5rem 0 2.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.search-clear:hover { color: var(--gray-700); background: var(--gray-100); }

/* Brands link button */
.btn-brands {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-color, #2c80d4);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-brands:hover { transform: translateY(-1px); opacity: 0.92; }

/* Theme Toggle Button */
.btn-theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  transition: all var(--transition-fast);
  overflow: hidden;
}
.btn-theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.btn-theme-toggle .theme-toggle-icon {
  font-size: 1.2rem;
  line-height: 1;
  display: none;
}
/* Default (light) theme shows the moon (click to go dark) */
[data-theme="light"] .btn-theme-toggle .theme-toggle-moon,
html:not([data-theme="dark"]) .btn-theme-toggle .theme-toggle-moon {
  display: inline-block;
}
/* Dark theme shows the sun (click to go light) */
[data-theme="dark"] .btn-theme-toggle .theme-toggle-sun {
  display: inline-block;
}

/* Cart Button */
.btn-cart {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  transition: all var(--transition-fast);
}

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

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.cart-badge.bump {
  animation: badgeBump 0.3s ease;
}

@keyframes badgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ─── Company / Brand Navigation ─────────────── */
.company-nav {
  position: relative;
  z-index: 91;
  background: linear-gradient(180deg, rgba(248,249,250,0.96), rgba(255,255,255,0.92));
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.company-scroll {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}
.company-scroll::-webkit-scrollbar { display: none; }

.company-pill {
  flex-shrink: 0;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.company-pill:hover { border-color: var(--primary); color: var(--primary); }
.company-pill.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.company-pill .pill-count {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  background: rgba(255,255,255,0.25);
}
.company-pill:not(.active) .pill-count { background: var(--gray-100); color: var(--text-tertiary); }

/* ─── Company Section (brand sub-separation) ──── */
.company-section {
  grid-column: 1 / -1;
  margin-top: 1.75rem;
}
.company-section:first-child { margin-top: 0; }

.company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-lg, 12px);
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(99,102,241,0.03));
  border: 1px solid rgba(79,70,229,0.12);
}
.company-header-info { display: flex; align-items: center; gap: 0.75rem; }
.company-emoji {
  font-size: 1.6rem;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.company-name { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.company-tagline { font-size: 0.8125rem; color: var(--text-tertiary); }
.company-count { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* Sub-category line within a company */
.category-subtitle {
  grid-column: 1 / -1;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0.85rem 0 0.35rem;
  padding-left: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.category-subtitle .category-count { font-size: 0.75rem; font-weight: 500; color: var(--text-tertiary); text-transform: none; }

/* Company label on a product card */
.product-card-company {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

/* ─── Category Navigation ──────────────────────── */
.category-nav {
  position: sticky;
  top: calc(var(--header-height) + var(--announcement-height, 0px));
  z-index: 90;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--category-nav-height);
  display: flex;
  align-items: center;
}

.category-scroll {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.category-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-pill .pill-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(255,255,255,0.25);
}

.category-pill:not(.active) .pill-count {
  background: var(--gray-100);
  color: var(--text-muted);
}

/* ─── Main Content ─────────────────────────────── */
.catalogue-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Products Container */
.products-container {
  display: block;
}

/* Products Grid (inner grid created by JS) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* Category Section */
.category-section {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.category-section:first-child { margin-top: 0; }

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  letter-spacing: -0.01em;
}

.category-title .category-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: transparent;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 0 0 1.5px rgba(234, 88, 12, 0.28);
  transform: translateY(-3px);
}

.product-card::after {
  content: 'View Details';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  text-align: center;
  padding: 1.5rem 0.5rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
  z-index: 3;
}

.product-card:hover::after {
  opacity: 1;
}

.product-card.unavailable {
  opacity: 0.7;
}

.product-card.unavailable:hover {
  opacity: 0.85;
}

/* Product Image */
.product-card-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image svg {
  color: var(--gray-300);
}

/* Sale Badge */
.sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 2;
}

/* Unavailable Overlay */
.unavailable-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--gray-800);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  z-index: 2;
}

/* Product Info */
.product-card-body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-category {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.product-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.product-price {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.price-current {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-900);
}

.price-original {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-savings {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
}

/* Add to Cart Button */
.btn-add-cart {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.28);
}

.btn-add-cart:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.4);
}

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

.btn-add-cart:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
}

.btn-add-proforma {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1.5px solid var(--info);
  background: var(--info-light);
  color: var(--info);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-add-proforma:hover {
  background: var(--info);
  color: #fff;
}

/* ─── Loading & Empty States ───────────────────── */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.empty-state p {
  font-size: 0.875rem;
}

/* ─── Cart Sidebar ─────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--cart-sidebar-width), 90vw);
  height: 100vh;
  background: var(--bg-card);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-xl);
}

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

/* Cart Header */
.cart-sidebar > .cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.cart-sidebar > .cart-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-900);
}

.btn-close-cart {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all var(--transition-fast);
}

.btn-close-cart:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* Cart Mode Tabs */
.cart-mode-tabs {
  display: flex;
  padding: 0.75rem 1.5rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-color);
  background: transparent;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 0.5rem;
  color: var(--text-muted);
  text-align: center;
}

.cart-empty p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
}

.cart-empty span {
  font-size: 0.8125rem;
}

/* Cart Item */
.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--gray-100);
  animation: slideIn 0.25s ease;
}

.cart-item:last-child { border-bottom: none; }

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

.cart-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cart-item-unavailable {
  font-size: 0.6875rem;
  color: var(--warning);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-qty button {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

.cart-item-qty span {
  width: 32px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-800);
}

.cart-item-total {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-900);
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.cart-item-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.cart-item-remove:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* Customer Info */
.customer-info {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.customer-info h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.customer-info .form-group {
  margin-bottom: 0.5rem;
}

.customer-info input,
.customer-info textarea {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  transition: all var(--transition-fast);
  resize: vertical;
}

.customer-info input:focus,
.customer-info textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.08);
}

.customer-info input::placeholder,
.customer-info textarea::placeholder { color: var(--text-muted); }

/* Cart Footer */
.cart-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  flex-shrink: 0;
  background: var(--gray-50);
}

.cart-summary {
  margin-bottom: 0.875rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.summary-row.total {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1.5px solid var(--border-color);
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cart-actions .btn-accent {
  flex: 1 1 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  flex: 1;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 8px 22px rgba(234, 88, 12, 0.42);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn-accent {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #219a52, #25a25a);
}

/* ─── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-product {
  max-width: 600px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.btn-modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all var(--transition-fast);
}

.btn-modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.modal-footer .btn { flex-shrink: 0; }

/* QR Code Modal */
.qr-code-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}

.qr-code-container img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
}

.qr-code-info {
  text-align: center;
  margin-bottom: 1rem;
}

.qr-code-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.qr-code-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-family);
  letter-spacing: 0.05em;
}

.qr-code-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.qr-summary {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem;
}

.qr-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.qr-summary-row.total {
  font-weight: 700;
  color: var(--gray-900);
  border-top: 1px solid var(--border-color);
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  font-size: 0.9375rem;
}

.qr-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
}

.qr-summary-item span:first-child {
  color: var(--text-secondary);
}

.qr-summary-item span:last-child {
  font-weight: 600;
  color: var(--gray-800);
}

/* Product Detail Modal */
.product-detail {
  display: flex;
  gap: 1.5rem;
}

.product-detail-image {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-image svg {
  color: var(--gray-300);
}

.product-detail-info {
  flex: 1;
  min-width: 0;
}

.product-detail-category {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.product-detail-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-detail-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.product-detail-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.product-detail-sku,
.product-detail-brand {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.product-detail-price {
  margin-bottom: 0.5rem;
}

.product-detail-price .price-current {
  font-size: 1.5rem;
}

.product-detail-stock {
  margin-bottom: 1rem;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.stock-badge.in-stock {
  background: var(--success-light);
  color: var(--success);
}

.stock-badge.out-of-stock {
  background: var(--danger-light);
  color: var(--danger);
}

.stock-badge .stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.product-detail-actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.product-detail-actions .btn {
  padding: 0.6rem 1rem;
  flex-shrink: 0;
}

/* ─── Toast Notifications ──────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  background: var(--gray-800);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 380px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

.toast-close:hover { color: #fff; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

/* ─── Utility ──────────────────────────────────── */
.hidden { display: none !important; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
  .search-bar { width: 240px; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.875rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --cart-sidebar-width: 100vw;
  }

  .header-inner { padding: 0 1rem; }
  .brand-text p { display: none; }

  .search-bar {
    width: 180px;
  }

  .search-bar input {
    height: 38px;
    font-size: 0.8125rem;
  }

  .catalogue-main { padding: 1rem; }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .product-card-body { padding: 0.75rem; }
  .product-card-name { font-size: 0.8125rem; }
  .price-current { font-size: 0.9375rem; }

  .product-detail {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .product-detail-image {
    width: 100%;
    height: 180px;
  }

  .product-detail-meta {
    justify-content: center;
  }

  .product-detail-actions {
    justify-content: center;
  }

  .modal {
    border-radius: var(--radius-lg);
    max-height: 85vh;
  }

  .toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast { max-width: 100%; }
}

@media (max-width: 480px) {
  .search-bar { width: 140px; }
  .header-brand h1 { font-size: 1rem; }
  .brand-icon { font-size: 1.5rem; }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .product-card-image svg { width: 40px; height: 40px; }
  .product-card-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .btn-add-cart, .btn-add-proforma { width: 100%; height: 34px; }
  .product-card-footer .product-buttons { display: flex; gap: 0.5rem; width: 100%; }
}

/* ─── Scrollbar ────────────────────────────────── */
.cart-items::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 5px;
}

.cart-items::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ─── Working Hours Banner ─────────────────────── */
.working-hours-banner {
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1.5rem;
}

.working-hours-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.working-hours-inner svg {
  flex-shrink: 0;
  color: var(--primary);
}

#working-hours-text {
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.working-hours-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.working-hours-status .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.working-hours-status.open {
  background: var(--success-light);
  color: var(--success);
}

.working-hours-status.open .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}

.working-hours-status.closed {
  background: var(--danger-light);
  color: var(--danger);
}

.working-hours-status.closed .status-dot {
  background: var(--danger);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── After-Hours Modal ────────────────────────── */
.after-hours-content {
  text-align: center;
  padding: 1rem 0;
}

.after-hours-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.after-hours-message {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.after-hours-apology {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.after-hours-schedule {
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  display: inline-block;
  text-align: left;
  min-width: 280px;
}

.after-hours-schedule h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.schedule-row:last-child {
  border-bottom: none;
}

.schedule-row .day {
  font-weight: 500;
  color: var(--text-primary);
}

.schedule-row .time {
  font-variant-numeric: tabular-nums;
}

/* ─── Floating Promo Sidebar ─────────────────── */
.promo-sidebar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  align-items: flex-start;
  transition: z-index 0s;
}

.promo-sidebar.hidden {
  display: none;
}

/* Toggle Button */
.promo-sidebar-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  box-shadow: -2px 2px 12px rgba(234, 88, 12, 0.35);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.promo-sidebar-toggle:hover {
  background: var(--primary-hover);
  box-shadow: -3px 3px 16px rgba(234, 88, 12, 0.45);
  transform: translateY(-50%) scale(1.05);
}

.promo-sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

/* Badge on toggle */
.promo-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4);
}

/* Panel */
.promo-sidebar-panel {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  width: 320px;
  max-height: 70vh;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.promo-sidebar.open .promo-sidebar-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* Header */
.promo-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.promo-sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.promo-sidebar-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.promo-sidebar-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* List */
.promo-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  scroll-behavior: smooth;
}

.promo-sidebar-list::-webkit-scrollbar {
  width: 4px;
}

.promo-sidebar-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

/* Promo Item Card */
.promo-sidebar-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  margin-bottom: 0.5rem;
  position: relative;
}

.promo-sidebar-item:last-child {
  margin-bottom: 0;
}

.promo-sidebar-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.1);
}

.promo-sidebar-item.active-highlight {
  background: var(--primary-light);
  border-color: var(--primary);
  animation: promoItemPulse 0.6s ease;
}

/* Item Image */
.promo-item-image {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-100);
}

.promo-item-image-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Item Info */
.promo-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.promo-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.promo-item-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--danger);
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.5;
  width: fit-content;
}

.promo-item-label.promo-source {
  background: var(--info);
}

/* Prices */
.promo-item-prices {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.promo-item-original-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.promo-item-sale-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.promo-item-savings {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-light);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.4;
}

/* Empty state */
.promo-sidebar-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.promo-sidebar-empty span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Cycle indicator */
.promo-cycle-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0.5rem 0.75rem 0.75rem;
  flex-shrink: 0;
}

.promo-cycle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: background 0.2s, transform 0.2s;
}

.promo-cycle-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* Animations */
@keyframes promoItemPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes promoSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.promo-sidebar.open .promo-sidebar-panel {
  animation: promoSlideIn 0.3s ease forwards;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .promo-sidebar-panel {
    width: calc(100vw - 60px);
    max-width: 320px;
  }

  .promo-sidebar-toggle {
    width: 38px;
    height: 38px;
  }

  .promo-sidebar-panel {
    right: 38px;
  }
}

/* ─── Fragrance Pyramid (perfume notes) ─────────────── */
.product-detail-notes { margin-top: 0.75rem; }
.scent-pyramid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(234,88,12,0.05), rgba(234,88,12,0.02));
  border: 1px solid var(--border-color);
}
.scent-family {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 3px 10px;
  border-radius: 999px;
}
.scent-tier { display: flex; flex-direction: column; gap: 0.3rem; }
.scent-tier-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.scent-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.scent-chip {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.4;
}
.scent-chip.scent-top   { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.scent-chip.scent-mid   { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
.scent-chip.scent-base  { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
[data-theme="dark"] .scent-chip.scent-top  { background: rgba(234,179,8,0.18); color: #fde68a; border-color: rgba(234,179,8,0.4); }
[data-theme="dark"] .scent-chip.scent-mid  { background: rgba(236,72,153,0.18); color: #f9a8d4; border-color: rgba(236,72,153,0.4); }
[data-theme="dark"] .scent-chip.scent-base { background: rgba(217,119,6,0.2); color: #fcd34d; border-color: rgba(217,119,6,0.4); }

/* ════════════════════════════════════════════════
   MOBILE OPTIMIZATION
   ════════════════════════════════════════════════ */

/* ── Tablet & small laptop ── */
@media (max-width: 768px) {
  .working-hours-inner {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    justify-content: center;
    text-align: center;
  }
  .cart-sidebar {
    width: 100vw;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* Cart action buttons: full-width stacked for easier thumb taps */
  .cart-actions .btn { flex: 1 1 100%; }
  .cart-actions .btn-secondary { flex: 1 1 calc(50% - 0.25rem); }
  /* Modal footer buttons stack full-width */
  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-footer .btn { width: 100%; }
}

/* ── Phone (portrait) ── */
@media (max-width: 600px) {
  :root {
    --header-height: 116px;
  }

  /* Two-row header: brand+icons row, then full-width search */
  .catalogue-header {
    height: auto;
    padding: 0.5rem 0;
  }
  .header-inner {
    flex-wrap: wrap;
    padding: 0 0.85rem;
    gap: 0.6rem;
  }
  .header-brand { flex: 1 1 auto; min-width: 0; }
  .header-brand .brand-text h1 { font-size: 1.05rem; }
  .header-actions {
    gap: 0.4rem;
    flex-shrink: 0;
  }
  /* Search drops to its own full-width row */
  .search-bar {
    flex: 1 1 100%;
    order: 5;
    width: 100%;
  }
  .search-bar input { height: 40px; font-size: 0.9rem; }

  /* Icon-only buttons: larger tap targets */
  .btn-theme-toggle, .btn-brands, .btn-cart {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  /* Company / category filter pills */
  .company-nav { padding: 0; }
  .company-pill {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .company-scroll {
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
    scroll-padding-left: 0.75rem;
  }

  .catalogue-main { padding: 0.75rem; }

  /* Tighter, thumb-friendly product grid */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem;
  }
  .product-card-image { aspect-ratio: 4 / 3; }
  .product-card-image svg { width: 44px; height: 44px; }
  .product-card-body { padding: 0.6rem 0.6rem 0.7rem; }
  .product-card-name {
    font-size: 0.78rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.95rem;
  }
  .price-current { font-size: 0.95rem; }

  /* Cart sidebar = full screen drawer */
  .cart-sidebar { width: 100vw; }
  .cart-sidebar > .cart-header { padding: 1rem 1rem; }
  .cart-footer { padding: 0.85rem 1rem; }

  /* Modals become bottom sheets for ergonomic reach */
  .modal-overlay { align-items: flex-end; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    border-radius: 18px 18px 0 0 !important;
    max-height: 92vh;
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .modal-product { max-width: 100% !important; }
  .modal-header, .modal-body { padding-left: 1rem; padding-right: 1rem; }
  .modal-body { padding-top: 1rem; padding-bottom: 1rem; }
  .modal-header h2 { font-size: 1rem; }

  /* QR code fits small screens */
  .qr-code-container { padding: 0.75rem; }
  .qr-code-container img { width: 180px; height: 180px; }
}


/* ════════════════════════════════════════════════
   MOBILE MODALS — guarantee popups never exceed the
   screen width (tablets + phones). Fixes flex
   min-width:auto overflow from wide internal content.
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Overlay: minimal padding, anchor to bottom for thumb reach */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  /* Modal: hard viewport clamp + box-sizing so border/padding count */
  .modal,
  .modal-product {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Let flex children shrink so a wide image/grid can't force overflow */
  .modal > *,
  .modal-body,
  .modal-header,
  .modal-footer {
    min-width: 0;
    max-width: 100%;
  }

  /* Wide body content scrolls horizontally inside, never outwards */
  .modal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Media + grid elements respect the modal width */
  .modal img,
  .modal svg,
  .modal video,
  .modal canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Footer buttons stack and stay reachable */
  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .modal-footer .btn { width: 100%; }
}

/* ════════════════════════════════════════════════
   MOBILE SAFETY NET — prevent any horizontal page
   overflow from banners / long text / stray widths
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* Working-hours text now wraps instead of forcing a wide row */
  .working-hours-banner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .working-hours-inner { flex-wrap: wrap; row-gap: 0.3rem; }
  #working-hours-text { white-space: normal; }

  /* Header must never exceed the viewport */
  .catalogue-header { max-width: 100vw; box-sizing: border-box; }
  .header-inner { max-width: 100%; box-sizing: border-box; }

  /* Sticky/fixed injected elements respect viewport */
  #catalogue-announcements { max-width: 100vw; box-sizing: border-box; }
}

/* ── Very small phones ── */
@media (max-width: 360px) {
  .header-brand .brand-icon { display: none; }
  .header-brand .brand-text p { display: none; }
  .working-hours-status { font-size: 0.72rem; }
  .products-grid { gap: 0.5rem; }
  .product-card-name { font-size: 0.74rem; }
  .price-current { font-size: 0.9rem; }
}
