@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  padding: 20px;
}
.lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
  margin: auto;
}
.lightbox-img:hover {
  transform: none;
}

/* ── Modal Image ── */
.modal-img-wrap {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-50);
  cursor: pointer;
}
.modal-img-wrap img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.modal-img-wrap img:hover {
  opacity: 0.85;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #1e3a8a;
  --primary-light: #93c5fd;
  --accent: #2563eb;
  --bg: #eff6ff;
  --white: #ffffff;
  --surface: #ffffff;
  --gray-50: #f1f5f9;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5e1;
  --gray-300: #94a3b8;
  --gray-400: #64748b;
  --gray-500: #475569;
  --gray-600: #334155;
  --gray-700: #1e293b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --blue-soft: #dbeafe;
  --blue-soft-text: #1d4ed8;
  --amber-soft: #fef3c7;
  --amber-soft-border: #fde68a;
  --amber-soft-text: #92400e;
  --red-soft: #fee2e2;
  --red-soft-2: #fee2e2;
  --red-soft-text: #991b1b;
  --green-soft: #f0fdf4;
  --green-soft-2: #dcfce7;
  --green-soft-border: #bbf7d0;
  --green-soft-text: #166534;
  --red-soft-border: #fca5a5;
  --indigo-soft: #eef2ff;
  --indigo-soft-text: #4338ca;
  --blue-soft-2: #dbeafe;
  --gray-soft: #f9fafb;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --gray-50: #182234;
  --gray-100: #334155;
  --gray-200: #475569;
  --gray-300: #64748b;
  --gray-400: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-600: #e2e8f0;
  --gray-700: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --blue-soft: #1d3a5f;
  --blue-soft-text: #93c5fd;
  --amber-soft: #3d2f12;
  --amber-soft-border: #6b5210;
  --amber-soft-text: #fcd34d;
  --red-soft: #3a1a20;
  --red-soft-2: #2f1419;
  --red-soft-text: #fca5a5;
  --green-soft: #12291f;
  --green-soft-2: #0e2119;
  --green-soft-border: #1e4a3a;
  --green-soft-text: #6ee7b7;
  --red-soft-border: #5b2028;
  --indigo-soft: #1e2a45;
  --indigo-soft-text: #a5b4fc;
  --blue-soft-2: #16233f;
  --gray-soft: #2a3a52;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Lock the inline axis so no child (e.g. the off-screen drawer) can push
     an RTL page sideways / clip the left edge on phones & tablets. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--gray-700);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  line-height: 1.7;
  direction: rtl;
  font-size: 18px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ── Promo Banner ── */
.promo-banner {
  background: linear-gradient(135deg, #1e3a5f, #3b82f6, #7c3aed);
  color: white;
  text-align: center;
  padding: 16px 28px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}
.promo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -25px;
  right: -25px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 16px,
    rgba(255,255,255,0.04) 16px,
    rgba(255,255,255,0.04) 17px
  );
  background-size: 24px 24px;
  animation: promoLineMove 1.5s linear infinite;
  pointer-events: none;
}
@keyframes promoLineMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(24px); }
}
.promo-banner i { font-size: 18px; }
.promo-icon {
  font-size: 22px;
  opacity: 0.25;
  position: relative;
  z-index: 1;
  display: inline-block;
  animation: promoFloat 3s ease-in-out infinite;
}
.promo-icon:nth-child(1) { animation-delay: 0s; }
.promo-icon:nth-child(2) { animation-delay: 0.4s; }
.promo-icon:nth-child(3) { animation-delay: 0.8s; }
.promo-icon:nth-child(5) { animation-delay: 1.2s; }
.promo-icon:nth-child(6) { animation-delay: 1.6s; }
.promo-icon:nth-child(7) { animation-delay: 2s; }
/* ── Promo Popup ── */
.promo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: promoFadeIn 0.4s ease;
}
.promo-modal {
  background: linear-gradient(135deg, #1e3a5f, #3b82f6, #7c3aed);
  border-radius: 20px;
  padding: 48px 40px 36px;
  max-width: 460px;
  width: 92%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: promoScaleIn 0.4s ease;
}
.promo-close {
  position: absolute;
  top: 12px;
  left: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.promo-close:hover { color: white; }
.promo-modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: #fbbf24;
}
.promo-modal h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
  color: white;
}
.promo-modal p {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 4px;
  line-height: 1.6;
}
.promo-modal .btn-primary {
  background: #fbbf24;
  color: #1e3a5f;
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.promo-modal .btn-primary:hover { background: #f59e0b; }
@keyframes promoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes promoScaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes promoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-4deg); }
  75% { transform: translateY(-4px) rotate(4deg); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Menu Toggle ── */
.menu-toggle {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 6px;
  display: block;
}
.menu-toggle:hover { color: var(--primary); }

/* ── Right-side Drawer (sidebar) ── */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -360px;
  width: 360px;
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  z-index: 300;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  /* Paint containment keeps the off-screen drawer + its children from
     expanding the page's scrollable area (which otherwise shifts the whole
     RTL layout to the right on phones/tablets). */
  contain: paint;
}
.mobile-sidebar.open { right: 0; }
@media (max-width: 400px) {
  .mobile-sidebar { right: -300px; width: 300px; }
  .mobile-sidebar.open { right: 0; }
}
.mobile-sidebar .sidebar-header,
.mobile-sidebar .sidebar-section {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}
.mobile-sidebar .sidebar-header .logo img { height: 48px !important; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 250;
  display: none;
}
.sidebar-overlay.open { display: block; }



.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  background: #f8fafc;
}
.sidebar-header .logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  gap: 10px;
  display: flex;
  align-items: center;
}
.menu-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 6px;
}
.menu-close:hover { color: var(--danger); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  font-size: 16px;
  color: var(--gray-600);
  transition: background 0.2s;
  text-decoration: none;
  font-weight: 500;
}
.sidebar-nav a:hover {
  background: #f1f5f9;
  color: var(--primary);
}
.sidebar-nav a i {
  width: 22px;
  text-align: center;
  color: var(--gray-400);
  font-size: 18px;
}
.sidebar-nav a:hover i { color: var(--primary); }

.sidebar-section {
  padding: 6px 0;
}
.sidebar-section + .sidebar-section {
  border-top: none;
  margin-top: 0;
  padding-top: 6px;
}
.sidebar-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-400);
  padding: 16px 28px 8px;
  letter-spacing: 0.5px;
}
.sidebar-section a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  font-size: 18px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}
.sidebar-section a:hover {
  background: #d0d0d0;
  color: var(--primary);
}
.sidebar-section a i {
  width: 24px;
  text-align: center;
  color: var(--gray-400);
  font-size: 20px;
}
.sidebar-section a:hover i { color: var(--primary); }

/* Sidebar accordion (categories + services) */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-400);
  padding: 16px 28px 8px;
  letter-spacing: 0.5px;
  text-align: right;
  font-family: inherit;
}
.sidebar-toggle i {
  font-size: 13px;
  transition: transform 0.3s ease;
  color: var(--gray-400);
}
.sidebar-section.open > .sidebar-toggle i,
.acc-item.open > .acc-row .acc-toggle i { transform: rotate(-90deg); }
.sidebar-section.open > .sidebar-toggle { color: var(--primary); animation: accFlash 0.5s ease; }
.sidebar-section > .acc-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.sidebar-section.open > .acc-sub { max-height: 58vh; overflow-y: auto; }
.acc-sub { overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.acc-item.open > .acc-sub { max-height: 300px; overflow-y: auto; }
.sidebar-acc { display: flex; flex-direction: column; }
.acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.acc-item.open > .acc-row { animation: accFlash 0.5s ease; }
@keyframes accFlash {
  0% { background: var(--blue-soft); }
  100% { background: transparent; }
}
.acc-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
  line-height: 1.6;
}
.acc-link:hover { background: var(--blue-soft); color: var(--primary); }
.acc-leaf { color: var(--gray-500); font-size: 12px; }
.acc-sub .acc-link { padding-right: 40px; }
.acc-sub .acc-sub .acc-link { padding-right: 52px; }
.acc-empty { padding: 14px 28px; font-size: 12px; color: var(--gray-400); }
.acc-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 4px 4px 4px 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
}
.acc-toggle:hover { background: var(--blue-soft); color: var(--primary); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ── Header ── */
header {
  background: var(--surface);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--primary);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-500);
  font-size: 16px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  background: #eff6ff;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.logo i {
  font-size: 28px;
}

.search-box {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  padding-right: 44px;
  border: 2px solid var(--gray-100);
  border-radius: 50px;
  font-size: 16px;
  transition: border-color 0.2s;
  background: var(--gray-50);
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.search-box i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-300);
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
  max-height: 360px;
  overflow-y: auto;
}

.search-results.active {
  display: block;
}

.search-results .result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--gray-50);
}

.search-results .result-item:last-child {
  border-bottom: none;
}

.search-results .result-item:hover {
  background: var(--gray-50);
}

.search-results .result-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gray-50);
  flex-shrink: 0;
}

.search-results .result-info {
  flex: 1;
  min-width: 0;
}

.search-results .result-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results .result-price {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.search-results .result-empty {
  padding: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
  background: transparent;
  color: var(--gray-500);
}

.header-btn:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.header-btn .badge { display: none; }

.cart-btn { position: relative; }

/* ── Minimal header actions (sidebar-first) ── */
.header-btn.cart-btn,
.header-btn.auth-btn,
.header-btn.logout-btn,
.header-btn.notif-btn {
  font-size: 0;
  padding: 0;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35), 0 2px 4px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.18);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.header-btn.cart-btn:hover,
.header-btn.auth-btn:hover,
.header-btn.logout-btn:hover,
.header-btn.notif-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(37,99,235,0.5), 0 3px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(-2px);
}
.header-btn.cart-btn:active,
.header-btn.auth-btn:active,
.header-btn.logout-btn:active,
.header-btn.notif-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 2px 8px rgba(37,99,235,0.4), inset 0 2px 6px rgba(0,0,0,0.2);
}
.header-btn.cart-btn i,
.header-btn.auth-btn i,
.header-btn.logout-btn i,
.header-btn.notif-btn i {
  font-size: 18px;
  margin: 0;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.header-btn .badge {
  position: absolute;
  top: -3px;
  inset-inline-start: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.header-btn.auth-btn.is-logged,
.header-btn.auth-btn.is-logged:hover {
  padding: 2px;
  transform: none;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35), 0 2px 4px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.4);
}
.header-btn.auth-btn.is-logged img.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.header-btn.logout-btn { display: none; }
.header-btn.logout-btn.is-logged { display: inline-flex; }

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: var(--white);
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -20px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.045) 0%, transparent 68%);
  border-radius: 50%;
  animation: floatGlow 9s ease-in-out infinite;
  opacity: 0;
}
@keyframes floatGlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.hero .shape-1 {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}
.hero .shape-2 {
  position: absolute;
  bottom: 25%;
  left: 8%;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.10);
  transform: rotate(45deg);
  animation: floatDiamond 8s ease-in-out infinite;
}
.hero .shape-3 {
  position: absolute;
  top: 15%;
  left: 15%;
  width: 80px;
  height: 80px;
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite;
}
.hero .shape-4 {
  position: absolute;
  bottom: 10%;
  right: 20%;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.10);
  border-radius: 50%;
  animation: pulse 4s ease-in-out infinite;
}
.hero .shape-5 {
  position: absolute;
  top: 30%;
  left: 5%;
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite 1s;
}
.hero .shape-6 {
  position: absolute;
  bottom: 35%;
  right: 5%;
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: pulse 5s ease-in-out infinite 0.5s;
}
.hero .shape-7 {
  position: absolute;
  top: 60%;
  left: 25%;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: 50%;
  animation: float 7s ease-in-out infinite 0.3s;
}
.hero .shape-8 {
  position: absolute;
  top: 10%;
  right: 30%;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 50%;
  animation: float 12s ease-in-out infinite 0.5s;
}
.hero .shape-9 {
  position: absolute;
  top: 8%;
  right: 22%;
  width: 36px;
  height: 36px;
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: 50%;
  animation: spinRing 14s linear infinite;
}
.hero .shape-10 {
  position: absolute;
  bottom: 30%;
  left: 6%;
  width: 56px;
  height: 56px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 50%;
  animation: spinRing 20s linear infinite reverse;
}
.hero .shape-11 {
  position: absolute;
  top: 45%;
  right: 8%;
  width: 44px;
  height: 44px;
  border: 2px dotted rgba(255,255,255,0.15);
  border-radius: 50%;
  animation: spinRing 24s linear infinite;
}
.hero .shape-12 {
  position: absolute;
  bottom: 10%;
  right: 24%;
  width: 26px;
  height: 26px;
  border: 2px dashed rgba(255,255,255,0.14);
  border-radius: 50%;
  animation: spinRing 12s linear infinite reverse;
}
.hero .shape-13 {
  position: absolute;
  top: 40%;
  left: 10%;
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.20);
  border-radius: 50%;
  animation: pulse 3.5s ease-in-out infinite 1.5s;
}
.hero .shape-14 {
  position: absolute;
  top: 28%;
  right: 6%;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.16);
  border-radius: 50%;
  animation: pulse 4.5s ease-in-out infinite 2s;
}

/* ── Hero maze pipes (smooth network, generated) ── */
.hero .hpipe, .hero .vpipe, .hero .miter, .hero .cap-h, .hero .cap-v {
  position: absolute;
  background: rgba(255,255,255,0.18);
}
.hero-pipes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero .hpipe { height: 3px; }
.hero .vpipe { width: 3px; }
.hero .miter { height: 3px; transform-origin: left center; transform: rotate(45deg); }
.hero .cap-h { height: 3px; }
.hero .cap-v { width: 3px; }
.hero .ppip { display: none; }
.hero .flow {
  position: absolute;
  top: 0;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.95);
  opacity: 0;
  animation-name: heroFlow;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes heroFlow {
  0% { left: -20px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.hero .dpipe {
  position: absolute;
  width: 3px;
  height: 354px;
  transform-origin: center center;
  pointer-events: none;
}
.hero .flow-v { width: 3px; height: 16px; animation-name: heroFlowY; }
@keyframes heroFlowY {
  0% { top: -20px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.hero .flow-r { animation-name: heroFlowR; }
@keyframes heroFlowR {
  0% { left: 100%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: -20px; opacity: 0; }
}
.hero .flow-yr { width: 3px; height: 16px; animation-name: heroFlowYR; }
@keyframes heroFlowYR {
  0% { top: 100%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: -20px; opacity: 0; }
}


@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}
@keyframes floatDiamond {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-20px) rotate(52deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.8); opacity: 1; }
}
@keyframes spinRing {
  to { transform: rotate(360deg); }
}

/* ── Hero wave divider ── */

/* ── Hero wave divider ── */
.hero-wave {
  position: relative;
  z-index: 2;
  margin-top: -1px;
}
.hero-wave svg {
  display: block;
  width: 100%;
  height: 50px;
}

.hero h1 {
  font-size: 42px;
  font-weight: 900;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 19px;
  opacity: 0.9;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btn {
  display: inline-block;
  padding: 14px 40px;
  background: var(--surface);
  color: var(--primary);
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}
.hero-link {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.18);
  color: var(--white);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 13px;
}
.hero-link:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}
.hero-link.hero-primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(37,99,235,0.4);
}
.hero-link.hero-primary:hover {
  background: #1d4ed8;
}

/* ── Home gateway: 4 big links under the hero ── */
.gate-section {
  padding: 26px 20px 6px;
}
.gate-section .gate-wrap {
  max-width: 1200px;
  margin: 0 auto;
}
.gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
}
.gate-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  color: var(--gray-700);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.gate-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.gate-ico {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #1e40af);
  color: var(--white);
  font-size: 20px;
}
.gate-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.gate-title {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.gate-arrow {
  font-size: 12px;
  color: var(--primary);
  transition: transform .25s ease;
}
.gate-card:hover .gate-arrow { transform: translateX(-4px); }
.gate-desc {
  font-size: 12.5px;
  color: var(--gray-400);
  line-height: 1.6;
}
@media (max-width: 640px) {
  .gate-section { padding: 18px 14px 4px; }
  .gate-card { padding: 13px 14px; }
  .gate-ico { flex-basis: 42px; width: 42px; height: 42px; font-size: 17px; }
}

/* ── Category Cards ── */
.category-section {
  padding: 40px 0;
  background: linear-gradient(180deg, #eff6ff 0%, transparent 100%);
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gray-700);
  position: relative;
  padding-bottom: 10px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.category-section {
  padding: 0 0 30px;
}

.splide.category-carousel {
  padding: 0 10px;
}

.splide.category-carousel .splide__track {
  padding: 10px 0;
}

.splide.category-carousel .splide__arrow {
  background: var(--surface);
  border: 2px solid var(--gray-100);
  box-shadow: var(--shadow);
  width: 40px;
  height: 40px;
  opacity: 1;
  transition: all 0.2s;
}

.splide.category-carousel .splide__arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.splide.category-carousel .splide__arrow:hover svg {
  fill: var(--white);
}

.splide.category-carousel .splide__arrow svg {
  fill: var(--primary);
}

.splide.category-carousel .splide__pagination {
  display: none;
}

.category-card {
  flex-shrink: 0;
  min-width: 170px;
  padding: 24px 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-bottom: 4px solid var(--primary-light);
  transition: all 0.3s;
  display: block;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.category-card i {
  font-size: 56px;
  color: var(--primary);
  margin-bottom: 14px;
}

.category-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px 0;
  height: 28px;
  overflow: hidden;
}

.category-card .category-sub {
  font-size: 16px;
  color: var(--gray-500);
  line-height: 1.5;
  height: 24px;
  overflow: hidden;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 0;
}
.category-grid a.category-card {
  min-width: 0;
}

.category-grid .category-card {
  border-bottom-color: transparent;
}



a.category-card {
  display: block;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.category-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
  border-bottom: 4px solid var(--primary-light);
  min-width: 170px;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

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

.category-card i {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 10px;
}

.category-card h3 {
  font-size: 16px;
  font-weight: 600;
}

/* ── Product Grid ── */
.products-section {
  padding: 40px 0;
  background: linear-gradient(180deg, transparent 0%, #dbeafe 100%);
}

/* ── Filter / Sort Bar ── */
.filter-sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  margin-top: -8px;
}
#sort-select {
  padding: 6px 14px;
  border: 2px solid var(--gray-100);
  border-radius: 50px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  cursor: pointer;
  color: var(--gray-600);
  outline: none;
  transition: border-color 0.2s;
}
#sort-select:hover { border-color: var(--primary-light); }
#sort-select:focus { border-color: var(--primary); }
#products-count { font-size: 12px; color: var(--gray-400); }

/* ── Category Tabs ── */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-tabs .tab {
  padding: 8px 20px;
  border: 2px solid var(--gray-100);
  border-radius: 50px;
  background: var(--surface);
  color: var(--gray-500);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tabs .tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.category-tabs .tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-right: 4px solid var(--primary-light);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-right-color: var(--primary);
}

.product-card .img-wrap {
  height: 200px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card .img-wrap .wishlist-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 2;
  transition: transform 0.15s;
  color: #ef4444;
}

.product-card .img-wrap .wishlist-btn:hover {
  transform: scale(1.15);
}

.product-card .img-wrap .wishlist-btn.wishlisted i {
  font-weight: 900;
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.product-card .img-wrap .placeholder-icon {
  font-size: 56px;
  color: var(--gray-200);
}

.product-card .img-wrap .sold-out-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(220,38,38,0.9);
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  z-index: 3;
  letter-spacing: 1px;
}
.product-card.sold-out { opacity: 0.85; }
.product-card.sold-out .img-wrap img { filter: grayscale(0.6); }

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

.product-card .info .price .old-price {
  text-decoration: line-through;
  color: var(--gray-400);
  font-size: 12px;
  margin-left: 6px;
}

.product-card .info .price .discount-price {
  color: var(--danger);
  font-weight: 700;
  font-size: 16px;
}

.product-card .info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

.product-card .info .desc {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 10px;
  flex: 1;
}

.product-card .info .price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.product-card .info .price .currency {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
}

.product-card .add-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
}

.product-card .add-btn:hover {
  background: var(--accent);
}

.product-card .add-btn:disabled {
  background: var(--gray-200);
  cursor: not-allowed;
}

.add-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}
.add-btn:hover {
  background: #2563eb;
}
.add-btn:disabled {
  background: var(--gray-200);
  cursor: not-allowed;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* ── Toast ── */
.fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(59,130,246,0.4);
  z-index: 999;
  text-decoration: none;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}
.fab:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(59,130,246,0.5);
  color: var(--white);
}

.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  min-width: 200px;
  text-align: center;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
  margin: auto;
  max-height: 90vh;
  overflow-y: auto;
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-detail-modal {
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 36px 28px 28px;
}
.product-detail-modal .modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  text-align: right;
}
.product-detail-modal .modal-body .detail-full {
  grid-column: 1 / -1;
}
.product-detail-modal .modal-body .detail-left {
  grid-column: 1;
}
.product-detail-modal .modal-body .detail-right {
  grid-column: 2;
}

@media (max-width: 640px) {
  .product-detail-modal { padding: 28px 16px 20px; }
  .product-detail-modal .modal-body { grid-template-columns: 1fr; }
}
.product-detail-modal .modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.product-detail-modal .modal-close:hover {
  background: var(--gray-100);
  color: var(--danger);
}
.product-detail-modal .modal-body { text-align: right; }
.product-detail-modal .modal-body h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
}

/* ── Auth Forms ── */
.auth-form {
  max-width: 400px;
  margin: 40px auto;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--primary);
}

.auth-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

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

.form-group label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--gray-500);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: border-color 0.2s;
  background: var(--gray-50);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  transition: background 0.2s;
}

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

.btn-outline {
  padding: 8px 20px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray-400);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ── Cart Page ── */
.cart-page { padding: 40px 0; }

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border-right: 4px solid var(--primary-light);
}

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-50);
}

.cart-item .item-info {
  flex: 1;
}

.cart-item .item-info h4 {
  font-size: 16px;
  font-weight: 600;
}

.cart-item .item-info .item-price {
  font-size: 13px;
  color: var(--gray-400);
}

.cart-item .qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item .qty-controls button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cart-item .qty-controls button:hover {
  background: var(--gray-100);
}

.cart-item .qty-controls span {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.cart-item .qty-wrap {
  position: relative;
}

.qty-flash-msg {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.45);
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, transform 0.35s, visibility 0.35s;
  animation: qtyMsgBob 0.9s ease-in-out 0.4s infinite;
}
.qty-flash-msg::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #f97316;
}
.qty-flash-msg.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@keyframes qtyMsgBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

.cart-item .qty-controls button.qty-flash {
  animation: qtyBtnPulse 1s ease-in-out infinite;
}
@keyframes qtyBtnPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.75);
    transform: scale(1);
    background: #ffedd5;
  }
  50% {
    box-shadow: 0 0 0 9px rgba(249, 115, 22, 0);
    transform: scale(1.14);
  }
}

.cart-item .item-total {
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 100px;
  text-align: left;
}

.cart-item .remove-btn {
  color: var(--danger);
  background: none;
  font-size: 18px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.cart-item .remove-btn:hover {
  opacity: 1;
}

.cart-item .loyalty-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cart-item .loyalty-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 2px solid var(--gray-100);
  border-radius: 20px;
  background: var(--surface);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cart-item .loyalty-btn i {
  font-size: 13px;
}

.cart-item .loyalty-btn small {
  font-size: 11px;
  color: var(--gray-400);
}

.cart-item .loyalty-btn.active {
  border-color: var(--primary);
  background: var(--bg);
  color: var(--primary);
}

.cart-item .loyalty-btn.active small {
  color: var(--primary);
}

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

.cart-item .item-info .loyalty-discount-line {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--danger);
}

.cart-summary {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}

.cart-summary .total-line {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wallet-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--gray-50);
  border-bottom: 1px solid var(--gray-50);
}
.wallet-toggle-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  flex: 1;
}
.wallet-toggle-info i {
  font-size: 18px;
  color: var(--primary);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-100);
  border-radius: 26px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  min-width: 50px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  color: var(--gray-200);
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 8px;
}

/* ── Product Detail ── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 0;
}

.product-detail .gallery {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

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

.product-detail .gallery .placeholder-icon {
  font-size: 120px;
  color: var(--gray-200);
}

.product-detail .detail-info h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.product-detail .detail-info .cat-badge {
  display: inline-block;
  padding: 4px 14px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.product-detail .detail-info .detail-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 16px 0;
}

.product-detail .detail-info .detail-desc {
  color: var(--gray-400);
  line-height: 1.8;
  margin-bottom: 20px;
}

.product-detail .detail-info .stock-info {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.product-detail .detail-info .stock-info.in-stock {
  color: var(--success);
}

/* ── Orders ── */
.orders-page { padding: 40px 0; }

.order-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-right: 4px solid var(--primary-light);
}

.order-status {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.order-status.pending { background: #fef3c7; color: #92400e; }
.order-status.paid { background: #d1fae5; color: #065f46; }
.order-status.shipped { background: #dbeafe; color: #1e40af; }
.order-status.delivered { background: #d1fae5; color: #065f46; }
.order-status.cancelled { background: #fee2e2; color: #991b1b; }

/* ── Contact Expert Circle ── */
.expert-section {
  padding: 40px 0;
}
.expert-circles {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.contact-expert-circle {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.contact-expert-circle a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.35);
  transition: transform 0.3s, box-shadow 0.3s;
  gap: 4px;
}
.contact-expert-circle a:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.5);
}
.contact-expert-circle a i {
  font-size: 32px;
  margin-bottom: 4px;
}
.contact-expert-circle a span:first-of-type {
  font-size: 13px;
  font-weight: 600;
}
.contact-expert-circle a .expert-phone {
  font-size: 13px;
  font-weight: 800;
  direction: ltr;
}

/* ── About Home Section ── */
.about-home-section {
  padding: 50px 0;
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
}
.about-home-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 2.2;
}
.about-home-content p {
  font-size: 21px;
  color: var(--gray-600);
  margin-bottom: 14px;
}
.about-home-content p:last-child {
  margin-bottom: 0;
}
.about-home-content strong {
  color: var(--primary);
  font-weight: 700;
}

/* ── Process Section ── */
.process-section {
  padding: 60px 0;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}
.process-steps {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.process-step {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  flex: 1 1 180px;
  max-width: 240px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border-bottom: 4px solid var(--primary-light);
}
.process-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--primary);
}
.step-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
}
.process-step h3 {
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.process-step p {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.7;
}

/* ── Footer ── */
footer {
  background: var(--gray-700);
  color: var(--gray-200);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

footer h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 12px;
}

footer ul li {
  margin-bottom: 6px;
  font-size: 13px;
}

footer ul li a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--gray-600);
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
}

/* ── Static Pages (About, Contact) ── */
.static-page {
  padding: 50px 0;
  min-height: 50vh;
}

.static-page h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--gray-700);
}

.static-content p {
  font-size: 13px;
  line-height: 2;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.static-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 20px;
  color: var(--gray-700);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.feature-item {
  background: var(--gray-50);
  padding: 28px 20px;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s;
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-item i {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 12px;
}

.feature-item h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.feature-item p {
  font-size: 13px;
  color: var(--gray-400);
  line-height: 1.7;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-item i {
  font-size: 24px;
  color: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.contact-item h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.contact-item p {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.8;
}

.contact-form h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gray-700);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  margin-bottom: 14px;
  transition: border-color 0.2s;
  background: var(--surface);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-form textarea {
  resize: vertical;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; padding: 8px 12px; gap: 6px 10px; position: relative; }
  .header-inner .menu-toggle { order: 0; flex-shrink: 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .header-inner .logo { order: 1; font-size: 0; gap: 0; flex-shrink: 0; }
  .header-inner .logo img { height: 36px !important; }
  .header-inner .header-actions { order: 2; display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-inline-start: auto; }
  .header-inner .header-btn.cart-btn,
  .header-inner .header-btn.auth-btn,
  .header-inner .header-btn.logout-btn { width: 38px; height: 38px; padding: 0; font-size: 0; }
  .header-inner .header-btn.cart-btn i,
  .header-inner .header-btn.auth-btn i,
  .header-inner .header-btn.logout-btn i { font-size: 16px; }
  .header-inner .header-btn.auth-btn.is-logged img.avatar { width: 32px; height: 32px; }
  .header-inner .search-box { order: 3; flex: 1 1 100%; min-width: 0; margin-top: 2px; }
  .header-inner .search-box input { font-size: 12px; padding: 8px 36px 8px 12px; }
  .nav-links { order: 4; flex-basis: 100%; justify-content: center; padding-top: 2px; gap: 4px; }
  .hero { padding: 24px 16px; min-height: 180px; }
  .hero h1 { font-size: 22px; margin-bottom: 6px; }
  .hero p { font-size: 13px; margin-bottom: 16px; max-width: 100%; }
  .hero-btn { padding: 10px 28px; font-size: 12px; }
  .hero .hero-deco { display: none; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .product-card .img-wrap { height: 130px; }
  .product-card .info { padding: 10px; }
  .product-card .info h3 { font-size: 12px; margin-bottom: 4px; line-height: 1.3; }
  .product-card .info .desc { font-size: 11px; line-height: 1.4; margin-bottom: 6px; }
  .product-card .info .price { font-size: 12px; margin-bottom: 8px; }
  .product-card .add-btn { font-size: 12px; padding: 6px; }
  .product-card .img-wrap .wishlist-btn { width: 28px; height: 28px; top: 4px; left: 4px; font-size: 11px; }
  .product-detail { grid-template-columns: 1fr; padding: 16px 0; gap: 16px; }
  .product-detail .gallery { min-height: 200px; }
  .product-detail .detail-info h1 { font-size: 16px; }
  .product-detail .detail-info .detail-price { font-size: 18px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-card { padding: 14px 10px; }
  .category-card i { font-size: 24px; margin-bottom: 4px; }
  .category-card h3 { font-size: 11px; height: auto; }
  .container { padding: 0 12px; }
  .header-actions { gap: 4px; }
  .header-btn { padding: 6px 10px; font-size: 12px; }
  .header-btn .badge { font-size: 9px; min-width: 18px; height: 18px; }
  .logo { font-size: 12px; gap: 6px; }
  .logo i { font-size: 18px; }
  .promo-banner { padding: 8px 16px; font-size: 12px; }
  .section-title { font-size: 16px; margin-bottom: 12px; padding-bottom: 6px; }
  .hero-links { gap: 6px; }
  .hero-link { padding: 6px 14px; font-size: 12px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card .img-wrap { height: 110px; }
  .product-card .info { padding: 8px; }
  .product-card .info h3 { font-size: 11px; }
  .product-card .info .desc { display: block; font-size: 10px; line-height: 1.3; margin-bottom: 4px; }
  .product-card .info .price { font-size: 12px; margin-bottom: 6px; }
  .product-card .add-btn { font-size: 11px; padding: 6px 4px; }
  .product-card .img-wrap .wishlist-btn { width: 24px; height: 24px; font-size: 10px; }
  .header-actions { gap: 2px; }
  .nav-links a { padding: 3px 6px; font-size: 11px; }
  .header-btn { padding: 4px 8px; font-size: 11px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 10px 8px; }
  .category-card i { font-size: 20px; }
  .category-card h3 { font-size: 10px; }
  .hero { padding: 20px 12px; min-height: 160px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 12px; }
  .container { padding: 0 10px; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .product-card .img-wrap { height: 90px; }
  .product-card .info { padding: 6px; }
  .product-card .info h3 { font-size: 10px; }
  .product-card .info .desc { font-size: 9px; }
  .product-card .info .price { font-size: 11px; }
  .product-card .add-btn { font-size: 10px; padding: 4px; }
  .product-card .img-wrap .wishlist-btn { width: 22px; height: 22px; font-size: 9px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .category-card { padding: 8px 6px; }
  .category-card i { font-size: 18px; }
  .category-card h3 { font-size: 9px; }
  .hero { min-height: 140px; padding: 16px 10px; }
  .hero h1 { font-size: 17px; }
  .hero p { font-size: 11px; }
  .container { padding: 0 8px; }
}

@media (max-width: 768px) {
  .profile-two-col { grid-template-columns: 1fr !important; }
}

/* ── Loyalty (Customer-facing) ── */
.loyalty-section {
  padding: 40px 0;
}

/* ── Talking handyman cards ── */
.idea-person {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 0;
  opacity: 0;
  transform: translateX(70px);
  transition: opacity .7s ease, transform .7s ease;
}
.idea-person.idea-left {
  flex-direction: row-reverse;
  transform: translateX(-70px);
}
.idea-person.in-view {
  opacity: 1;
  transform: none;
}
.idea-person img {
  width: auto;
  height: 140px;
  flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.12);
}
.idea-bubble {
  position: relative;
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--gray-100);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--gray-700);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.idea-bubble::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.idea-person.idea-right .idea-bubble::before {
  right: -12px;
  border-left: 12px solid var(--surface);
}
.idea-person.idea-left .idea-bubble::before {
  left: -12px;
  border-right: 12px solid var(--surface);
}
.idea-role {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue-soft-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 50px;
  margin-bottom: 6px;
}
.idea-count {
  color: var(--primary);
  font-size: 20px;
}
.idea-cta {
  margin-top: 8px;
  font-weight: 700;
  color: var(--primary);
}
.idea-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  margin-right: 6px;
}
@media (max-width: 480px) {
  .idea-person,
  .idea-person.idea-left {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .idea-person img {
    height: 120px;
  }
  .idea-bubble {
    width: 100%;
    font-size: 13px;
    padding: 12px 14px;
  }
  .idea-bubble::before {
    display: none;
  }
}

.loyalty-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid #fcd34d;
}
.loyalty-banner i {
  font-size: 36px;
  color: #d97706;
  flex-shrink: 0;
}
.loyalty-banner strong {
  font-size: 16px;
  color: #92400e;
}
.loyalty-banner p {
  font-size: 13px;
  color: #a16207;
  margin: 4px 0 0;
}
.loyalty-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.loyalty-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--gray-50);
  flex-shrink: 0;
}
.loyalty-item .info {
  flex: 1;
  min-width: 0;
}
.loyalty-item .info .name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loyalty-item .info .price {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}
.loyalty-item .bar-wrap {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}
.loyalty-item .bar-wrap .bar {
  background: var(--gray-50);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}
.loyalty-item .bar-wrap .bar .fill {
  height: 10px;
  border-radius: 10px;
  transition: width 0.3s;
  background: var(--primary);
}
.loyalty-item .bar-wrap .label {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 4px;
}
.loyalty-item .pct {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  min-width: 50px;
  text-align: center;
}
.loyalty-item .free-badge {
  background: var(--success);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.star-selector:hover,
.star-selector:hover ~ .star-selector {
  color: #f59e0b;
}

/* ── Order Timeline ── */
.order-card-wrapper {
  margin-bottom: 12px;
}

.order-actions {
  display: flex;
  gap: 8px;
  padding: 8px 20px 4px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  width: auto;
  display: inline-block;
  text-align: center;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-sm:hover {
  background: var(--primary);
  color: var(--white);
}

.order-timeline {
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 16px 20px;
  margin-top: 0;
}

.timeline {
  position: relative;
  padding-right: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  right: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-right: -24px;
  margin-top: 2px;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px currentColor;
}

.timeline-dot.gray { background: var(--gray-400); color: var(--gray-400); }
.timeline-dot.blue { background: #3b82f6; color: #3b82f6; }
.timeline-dot.orange { background: #f59e0b; color: #f59e0b; }
.timeline-dot.green { background: #10b981; color: #10b981; }
.timeline-dot.red { background: #ef4444; color: #ef4444; }

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.timeline-date {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ── Comprehensive Responsive ── */
@media (max-width: 768px) {
  .profile-two-col { grid-template-columns: 1fr !important; }
  .profile-two-col > div { padding: 16px !important; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 16px; }
  .footer-grid ul { justify-content: center; }
  footer { padding: 20px 14px 14px; margin-top: 32px; }
  footer h4 { font-size: 12px; }
  footer ul li { font-size: 12px; }
  .cart-item { flex-wrap: nowrap; gap: 10px; padding: 12px; }
  .cart-item img { width: 48px; height: 48px; }
  .cart-item .item-info h4 { font-size: 13px; }
  .cart-item .qty-controls button { width: 30px; height: 30px; font-size: 12px; }
  .cart-summary { padding: 16px; margin: 12px; }
  .cart-summary .total-line { font-size: 16px; }
  .auth-form { margin: 14px 12px; padding: 20px 16px; }
  .container { padding: 0 12px; }
  .expert-circles { gap: 12px; }
  .contact-expert-circle a { width: 100px; height: 100px; }
  .contact-expert-circle a i { font-size: 20px; }
  .contact-expert-circle a span:first-of-type { font-size: 11px; }
  .contact-expert-circle a .expert-phone { font-size: 11px; }
  .features-grid { gap: 10px; grid-template-columns: 1fr 1fr; }
  .feature-item { padding: 16px 14px; }
  .feature-item i { font-size: 24px; }
  .feature-item h3 { font-size: 13px; }
  .products-section { padding: 16px 0; }
  .category-section { padding: 0 0 12px; }
  .order-card { padding: 12px; gap: 8px; }
  .order-card .order-header { font-size: 13px; }
  .order-status { font-size: 11px; padding: 3px 10px; }
  .process-step { padding: 10px 8px; }
  .step-icon { width: 36px; height: 36px; font-size: 16px; }
  .process-step h3 { font-size: 13px; }
  .process-step p { font-size: 11px; }
  .static-page h1 { font-size: 18px; }
  .static-content p { font-size: 13px; }
  .contact-grid { gap: 16px; }
  .contact-item h3 { font-size: 12px; }
  .contact-item p { font-size: 13px; }
  .contact-form input, .contact-form textarea { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .category-tabs .tab { font-size: 12px; padding: 6px 12px; }
  .modal { padding: 16px; }
  .modal h2 { font-size: 16px; }
  .order-actions { gap: 6px; padding: 8px 12px; }
  .btn-sm { font-size: 11px; padding: 6px 10px; min-height: 32px; }
}

@media (max-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card .img-wrap { height: 120px; }
  .product-card .info { padding: 8px; }
  .product-card .info h3 { font-size: 11px; margin-bottom: 3px; }
  .product-card .info .desc { display: block; font-size: 10px; line-height: 1.3; margin-bottom: 4px; }
  .product-card .info .price { font-size: 12px; margin-bottom: 6px; }
  .product-card .add-btn { font-size: 11px; padding: 6px; }
  .product-card .img-wrap .wishlist-btn { width: 26px; height: 26px; top: 4px; left: 4px; font-size: 11px; }
  .hero { padding: 24px 14px; min-height: 180px; }
  .hero h1 { font-size: 20px; margin-bottom: 6px; }
  .hero p { font-size: 13px; margin-bottom: 14px; }
  .hero .hero-deco { display: none; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 12px 8px; }
  .category-card i { font-size: 22px; margin-bottom: 4px; }
  .category-card h3 { font-size: 11px; }
  .section-title { font-size: 16px; margin-bottom: 10px; }
  .products-section { padding: 16px 0; }
  .container { padding: 0 10px; }
  .loyalty-banner { flex-direction: row; text-align: right; padding: 14px; }
  .loyalty-banner i { font-size: 24px; }
  .loyalty-banner strong { font-size: 13px; }
  .loyalty-banner p { font-size: 11px; }
  .loyalty-item { flex-wrap: nowrap; gap: 8px; padding: 10px; }
  .loyalty-item .bar-wrap { min-width: 80px; max-width: 120px; flex: 1; }
  .loyalty-item .pct { min-width: 36px; font-size: 13px; }
  .order-card { padding: 10px 12px; }
  .order-card .order-header { flex-direction: row; gap: 4px; }
  .order-card .order-body { flex-direction: row; gap: 4px; }
  .nav-links { gap: 4px; overflow-x: auto; white-space: nowrap; padding: 4px 0; }
  .nav-links a { padding: 4px 8px; font-size: 12px; }
  .hero-links { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .hero-link { padding: 6px 14px; font-size: 12px; }
  .category-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .category-tabs .tab { white-space: nowrap; font-size: 12px; padding: 5px 12px; flex-shrink: 0; }
  .modal { padding: 14px; }
  .modal h2 { font-size: 13px; }
  .detail-grid { grid-template-columns: 1fr !important; }
  .order-actions { flex-wrap: wrap; gap: 4px; padding: 8px 12px; }
  .btn-sm { font-size: 11px; padding: 5px 10px; min-height: 30px; }
  .timeline { padding-right: 16px; }
  .timeline-dot { width: 14px; height: 14px; margin-right: -16px; }
  .timeline-content { font-size: 12px; }
  .cart-item .loyalty-choices { width: auto; justify-content: flex-start; }
  .cart-item .loyalty-btn { font-size: 11px; padding: 4px 8px; }
  .checkout-steps { padding: 0 4px; gap: 0; }
  .step-circle { width: 28px; height: 28px; font-size: 12px; }
  .step-connector { width: 24px; margin-top: -16px; }
  .step-label { font-size: 9px; }
}

@media (max-width: 400px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-card { flex-direction: column; }
  .product-card .img-wrap { height: 110px; }
  .product-card .info { padding: 8px; }
  .product-card .info h3 { font-size: 12px; margin-bottom: 4px; }
  .product-card .info .price { font-size: 13px; }
  .product-card .info .desc { display: none; }
  .product-card .add-btn { font-size: 12px; padding: 6px; }
  .product-card .img-wrap .wishlist-btn { width: 28px; height: 28px; font-size: 11px; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .category-card { padding: 16px 12px; }
  .category-card i { font-size: 28px; margin-bottom: 6px; }
  .category-card h3 { font-size: 13px; }
  .hero h1 { font-size: 22px; }
  .header-btn { padding: 8px 12px; font-size: 13px; }
  .auth-form { margin: 10px; padding: 16px 14px; }
  .container { padding: 0 10px; }
}

/* ── Login/Register page ── */
@media (max-width: 640px) {
  .auth-form { max-width: 100%; margin: 12px 10px; padding: 18px 14px; }
  .auth-form h2 { font-size: 16px; margin-bottom: 14px; }
  .auth-form .form-group { margin-bottom: 10px; }
  .auth-form input, .auth-form select { min-height: 38px; padding: 8px 12px; font-size: 12px; }
  .auth-form .btn-primary { min-height: 38px; font-size: 12px; padding: 10px; }
  /* Role buttons: horizontal */
  .auth-form .role-btn { padding: 8px 8px !important; font-size: 12px !important; }
  .auth-form .role-btn > div:first-child { font-size: 18px !important; margin-bottom: 0 !important; }
  .auth-form .role-btn > div:nth-child(3) { font-size: 9px !important; }
  /* Verification code input */
  .auth-form input[id="verify-code"],
  .auth-form input[id="reset-code"] {
    font-size: 20px !important;
    letter-spacing: 8px !important;
    padding: 8px !important;
    min-height: 44px !important;
  }
  /* Application form textareas */
  .auth-form textarea {
    min-height: 60px;
    padding: 10px;
    font-size: 12px;
  }
  .auth-switch { margin-top: 12px; font-size: 13px; line-height: 1.6; }
  .auth-switch a { padding: 2px; }
}

@media (max-width: 480px) {
  .auth-form { margin: 10px; padding: 16px 12px; }
  .auth-form h2 { font-size: 13px; margin-bottom: 12px; }
  .auth-form input, .auth-form select { min-height: 36px; padding: 8px 10px; font-size: 13px; }
  .auth-form .btn-primary { min-height: 36px; font-size: 13px; padding: 8px; }
  /* Role buttons stack vertically */
  .auth-form #register-form [style*="display:flex"][style*="gap:8px"] {
    flex-direction: column !important;
    gap: 4px !important;
  }
  .auth-form .role-btn {
    padding: 10px 10px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: right !important;
  }
  .auth-form .role-btn > div:first-child { font-size: 18px !important; margin-bottom: 0 !important; }
  .auth-form .role-btn > div:nth-child(2) { min-width: 50px; font-size: 13px !important; }
  .auth-form .role-btn > div:nth-child(3) { font-size: 10px !important; }
}

@media (max-width: 380px) {
  .auth-form { margin: 6px; padding: 14px 10px; }
  .auth-form h2 { font-size: 12px; margin-bottom: 10px; }
  .auth-form input, .auth-form select { min-height: 34px; padding: 6px 8px; font-size: 13px; }
  .auth-form .btn-primary { min-height: 34px; font-size: 13px; padding: 8px; }
}

/* ── Checkout Steps ── */
.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0 32px;
  padding: 0 20px;
}

.checkout-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  background: var(--gray-100);
  color: var(--gray-400);
  transition: all 0.3s;
  border: 3px solid var(--gray-200);
}

.checkout-step.active .step-circle {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

.checkout-step.completed .step-circle {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
  transition: color 0.3s;
}

.checkout-step.active .step-label {
  color: var(--primary);
}

.checkout-step.completed .step-label {
  color: var(--success);
}

.step-connector {
  width: 60px;
  height: 3px;
  background: var(--gray-200);
  margin: -24px 4px 0;
  border-radius: 2px;
  transition: background 0.3s;
}

.checkout-step.active + .step-connector,
.checkout-step.completed + .step-connector {
  background: var(--success);
}

.step-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-panel.active {
  display: block;
}

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

@media (max-width: 480px) {
  .checkout-steps { gap: 0; padding: 0 8px; }
  .step-circle { width: 34px; height: 34px; font-size: 12px; }
  .step-connector { width: 30px; margin-top: -20px; }
  .step-label { font-size: 10px; }
}

/* ── touch-friendly global ── */
@media (max-width: 768px) {
  input, select, textarea, .btn-primary, button, .header-btn {
    font-size: 14px !important;
  }
  .form-group { margin-bottom: 12px; }
  .form-group label { font-size: 12px; }
  .form-group input, .form-group select, .form-group textarea {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px !important;
  }
  .form-group textarea { min-height: 60px; }
  .btn-primary { padding: 10px !important; min-height: 38px; font-size: 14px !important; }
  .auth-form { padding: 20px 16px; margin: 12px 10px; }
  .auth-form h2 { font-size: 16px; margin-bottom: 16px; }
  .modal { max-width: 100%; margin: 10px; padding: 20px 16px; }
  .cart-page { padding: 12px 0; }
  .cart-item { padding: 12px; gap: 10px; }
  .cart-item img { width: 44px; height: 44px; }
  .cart-item .item-info h4 { font-size: 13px; }
  .cart-item .item-info .item-price { font-size: 12px; }
  .cart-item .qty-controls button { width: 30px; height: 30px; font-size: 12px; }
  .cart-item .item-total { font-size: 13px; min-width: 60px; }
  .orders-page { padding: 12px 0; }
  .order-card { flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
  .about-home-content p { font-size: 12px; }
  .about-home-section { padding: 24px 0; }
  .process-step { flex: 1; min-width: 0; padding: 12px 8px; }
  .process-steps { gap: 8px; }
  .process-section { padding: 24px 0; }
  .static-page { padding: 16px 0; }
  .static-page h1 { font-size: 18px; }
  .contact-grid { gap: 16px; }
  .contact-form input, .contact-form textarea { min-height: 38px; padding: 10px 12px; }
}

/* ── Fix for inputs on iOS ── */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}

/* ── Profile page responsive ── */
@media (max-width: 768px) {
  .profile-page { padding: 16px; }
  .profile-header { flex-direction: column; text-align: center; gap: 12px; }
  .profile-avatar { margin: 0 auto; }
}

/* ── Chat page responsive ── */
@media (max-width: 768px) {
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; max-height: 200px; }
  .chat-main { height: calc(100vh - 200px); }
}

/* ═══════════════════════════════════════════════
   Modern UX layer — softer, friendlier, less boxy
   ═══════════════════════════════════════════════ */
:root {
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 20px -8px rgba(30, 64, 175, 0.14);
  --shadow-md: 0 18px 44px -14px rgba(30, 64, 175, 0.25);
}

body {
  background:
    radial-gradient(900px 380px at 85% -5%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(700px 320px at 0% 30%, rgba(37, 99, 235, 0.10), transparent 60%),
    linear-gradient(180deg, #eef5ff 0%, #deebfe 100%);
}

/* ── Header: airy & soft ── */
header {
  border-bottom: none;
  box-shadow: 0 8px 28px -16px rgba(30, 64, 175, 0.28);
}
.nav-links a { border-radius: 999px; }
.header-btn { border-radius: 999px; }
.header-btn:hover { background: #eaf2ff; }
.search-box input {
  background: var(--surface);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(30, 64, 175, 0.08) inset;
}
.search-box input:focus {
  border-color: var(--primary-light);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.search-results { border: none; border-radius: 16px; box-shadow: 0 18px 44px -12px rgba(2, 6, 23, 0.25); overflow: hidden; }
.search-results .result-item:hover { background: #f0f6ff; }

/* ── Hero: softer gradient, gentle bottom curve ── */
.hero {
  background: radial-gradient(1000px 480px at 85% -10%, rgba(147, 197, 253, 0.35), transparent 60%),
              radial-gradient(800px 420px at 10% 120%, rgba(37, 99, 235, 0.35), transparent 60%),
              linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #1e40af 100%);
  border-radius: 0 0 42px 42px;
  margin-bottom: 8px;
}

/* ── Section titles: friendlier underline ── */
.section-title { font-size: 28px; }
.section-title::after {
  width: 90px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60a5fa, transparent);
}

/* ── Category cards: soft surfaces, no hard bars ── */
.category-card,
a.category-card {
  border: none;
  border-bottom: none;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
  box-shadow: 0 8px 24px -12px rgba(30, 64, 175, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px -14px rgba(30, 64, 175, 0.30);
}
.category-card.active {
  background: linear-gradient(160deg, #eff6ff, #dbeafe);
  border-color: transparent;
}
.category-card i { font-size: 44px; }

/* ── Product cards: no colored bars, clean lift ── */
.product-card {
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
  box-shadow: 0 8px 24px -12px rgba(30, 64, 175, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px -14px rgba(30, 64, 175, 0.30);
}
.product-card .img-wrap { background: linear-gradient(180deg, #f8fbff, #eef4ff); }
.product-card .img-wrap .placeholder-icon {
  font-size: 60px;
  color: #3b82f6;
  opacity: 0.75;
  text-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}
.product-card .img-wrap:has(.placeholder-icon) {
  background: linear-gradient(170deg, #e8f1ff 0%, #cfe2ff 100%);
}
.product-card .img-wrap .sold-out-badge,
.product-card .img-wrap .discount-badge { border-radius: 999px; }

/* ── Filter bar & category tabs: pill chips ── */
#sort-select,
.filter-sort-bar select {
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 4px 14px -6px rgba(30, 64, 175, 0.18);
  padding: 8px 18px;
}
.category-tabs .tab {
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 4px 14px -6px rgba(30, 64, 175, 0.14);
  font-weight: 600;
}
.category-tabs .tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.55);
}

/* ── Buttons: rounded, gradient, alive ── */
.btn-primary {
  width: 100%;
  padding: 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(37, 99, 235, 0.65);
  filter: brightness(1.06);
}
.btn-outline {
  border-radius: 999px;
  border-width: 2px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-outline:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.4); }

/* ── Forms: softer inputs ── */
.auth-form {
  border: none;
  border-top: none;
  border-radius: 22px;
  box-shadow: 0 24px 60px -20px rgba(30, 64, 175, 0.35);
}
.form-group input, .form-group select, .form-group textarea,
.contact-form input, .contact-form textarea {
  border: 2px solid var(--gray-100);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: var(--surface);
}

/* ── Footer: deep calm navy ── */
footer {
  background: linear-gradient(180deg, #16233f 0%, #0d1730 100%);
  margin-top: 72px;
}

/* ── Promo banner: livelier gradient ── */
.promo-banner {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6 45%, #0ea5e9);
}

/* ══════════ Animation System ══════════ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Keyframes */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes scaleOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.92); } }
@keyframes lift { 0% { transform: translateY(0); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(3deg); } 75% { transform: rotate(-3deg); } }
@keyframes textShift { 0% { letter-spacing: 0; } 50% { letter-spacing: 0.08em; } 100% { letter-spacing: 0; } }
@keyframes clipReveal {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}
@keyframes clipRevealReverse {
  0% { clip-path: inset(0 0 0 100%); }
  100% { clip-path: inset(0 0 0 0); }
}
@keyframes magneticPull {
  0% { transform: translate(0, 0); }
  100% { transform: translate(var(--mx), var(--my)); }
}

/* Utility animation classes */
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-down { animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-left { animation: slideLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide-right { animation: slideRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-in { animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-lift { animation: lift 0.4s ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-shimmer { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce { animation: bounce 0.6s ease-out; }
.animate-wiggle { animation: wiggle 0.5s ease-out; }
.animate-text-shift { animation: textShift 0.4s ease-out; }
.animate-clip-reveal { animation: clipReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-clip-reveal-reverse { animation: clipRevealReverse 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Stagger delays */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* Scroll-triggered base (JS adds .in-view) */
.scroll-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal.in-view { opacity: 1; transform: translateY(0); }
.scroll-reveal-left { opacity: 0; transform: translateX(-32px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal-left.in-view { opacity: 1; transform: translateX(0); }
.scroll-reveal-right { opacity: 0; transform: translateX(32px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal-right.in-view { opacity: 1; transform: translateX(0); }
.scroll-reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal-scale.in-view { opacity: 1; transform: scale(1); }
.scroll-reveal-clip { opacity: 0; clip-path: inset(0 100% 0 0); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.scroll-reveal-clip.in-view { opacity: 1; clip-path: inset(0 0 0 0); }

/* Parallax */
.parallax { will-change: transform; }
.parallax-layer { transform: translateZ(0); backface-visibility: hidden; }

/* Magnetic CTA */
.magnetic { position: relative; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform; }
.magnetic::before { content: ''; position: absolute; inset: -4px; border-radius: inherit; opacity: 0; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--primary) 0%, transparent 70%); transition: opacity 0.3s; pointer-events: none; z-index: -1; }
.magnetic:hover::before { opacity: 0.15; }
.magnetic:active { transition-duration: 0.05s; }

/* Image zoom */
.img-zoom { overflow: hidden; border-radius: inherit; }
.img-zoom img { transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform; }
.img-zoom:hover img { transform: scale(1.08); }
.img-zoom:active img { transform: scale(1.04); }

/* Text shift on hover */
.text-shift { display: inline-block; transition: letter-spacing 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.text-shift:hover { letter-spacing: 0.06em; }

/* Press + spring click feedback */
.pressable { transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.08s; }
.pressable:active { transform: scale(0.96); box-shadow: var(--shadow-sm); }
.pressable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Spring button */
.btn-spring { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s; }
.btn-spring:active { transform: scale(0.92); }
.btn-spring:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Cart icon animation */
.cart-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.cart-icon .cart-count { position: absolute; top: -6px; left: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; transform: scale(0); transform-origin: top right; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cart-icon.has-count .cart-count { transform: scale(1); }
.cart-icon.bump .cart-count { animation: cartBump 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cartBump { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }
.cart-icon svg { transition: transform 0.2s ease; }
.cart-icon:active svg { transform: scale(0.9); }

/* Step indicator (purchase process) */
.step-indicator { display: flex; align-items: center; gap: 8px; position: relative; }
.step-indicator::before { content: ''; position: absolute; top: 50%; left: 50%; width: 100%; height: 2px; background: var(--gray-200); transform: translate(-50%, -50%); z-index: 0; }
.step-indicator .step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.step-indicator .step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-100); border: 2px solid var(--gray-200); display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-weight: 700; font-size: 13px; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.step-indicator .step.active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.15); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25); }
.step-indicator .step.completed .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step-indicator .step.completed .step-dot::before { content: '\f00c'; font-family: 'Font Awesome 5 Free'; font-weight: 900; font-size: 12px; }
.step-indicator .step-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-align: center; white-space: nowrap; transition: color 0.3s; }
.step-indicator .step.active .step-label { color: var(--primary); }
.step-indicator .step.completed .step-label { color: var(--success); }
.step-indicator .step-progress { position: absolute; top: 50%; left: 0; height: 2px; background: var(--primary); transform: translateY(-50%); width: 0%; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); z-index: 0; }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
.skeleton-text { height: 1em; margin-bottom: 0.5em; border-radius: 4px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--gray-100); }

/* Page transition */
.page-transition { animation: fadeIn 0.3s ease-out; }

/* Modal/overlay entrance */
.modal-enter { animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.modal-leave { animation: scaleOut 0.2s ease-in; }

/* Toast entrance */
.toast-enter { animation: slideRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.toast-leave { animation: slideLeft 0.25s ease-in; }

/* Dropdown/menu */
.dropdown-enter { animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: top; }
.dropdown-leave { animation: scaleOut 0.15s ease-in; transform-origin: top; }

/* Tab/content switch */
.tab-content { animation: fadeIn 0.3s ease-out; }

/* Hero entrance */
.hero-title { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.hero-subtitle { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards; opacity: 0; }
.hero-links { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards; opacity: 0; }
.hero-cta { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }

/* Gate cards entrance */
.gate-card { opacity: 0; animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.gate-card:nth-child(1) { animation-delay: 0.1s; }
.gate-card:nth-child(2) { animation-delay: 0.15s; }
.gate-card:nth-child(3) { animation-delay: 0.2s; }
.gate-card:nth-child(4) { animation-delay: 0.25s; }

/* Product card entrance */
.product-card { opacity: 0; animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.product-grid .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-grid .product-card:nth-child(2) { animation-delay: 0.1s; }
.product-grid .product-card:nth-child(3) { animation-delay: 0.15s; }
.product-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
.product-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
.product-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
.product-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
.product-grid .product-card:nth-child(8) { animation-delay: 0.4s; }

/* Section title reveal */
.section-title { position: relative; display: inline-block; }
.section-title::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 3px; background: var(--primary); border-radius: 2px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.section-title.in-view::after { width: 60%; }

/* ── Responsive fixes ── */
@media (max-width: 480px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .section-title { font-size: 20px !important; }
  
  /* Filter bars: stack vertically on small screens */
  .filter-bar, [style*="flex-wrap:wrap"] {
    gap: 8px !important;
  }
  
  /* Make all filter selects full-width */
  select[style*="min-width"] {
    min-width: 100% !important;
    width: 100% !important;
  }
  
  /* Button touch targets: ensure 44px minimum */
  .btn-primary, .btn-outline {
    min-height: 44px;
    padding: 10px 16px !important;
  }
  
  /* Table horizontal scroll */
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  /* Company detail page */
  .company-header { flex-direction: column; align-items: flex-start !important; }
  
  /* iframe responsive */
  iframe[style*="height: 520px"] {
    height: 300px !important;
  }
}

@media (min-width: 481px) and (max-width: 1024px) {
  /* Tablet adjustments */
  .hero-links { gap: 12px; }
}

/* ══════════ Dark Mode ══════════ */
[data-theme="dark"] { color-scheme: dark; background: var(--bg); }

[data-theme="dark"] .mobile-sidebar { background: #182234; }
[data-theme="dark"] .sidebar-header { background: #1e293b; }
[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-section a:hover { background: #334155; }
[data-theme="dark"] .sidebar-toggle,
[data-theme="dark"] .acc-toggle,
[data-theme="dark"] .acc-empty { color: #94a3b8; }
[data-theme="dark"] .sidebar-section.open > .sidebar-toggle { color: var(--primary-light); }
[data-theme="dark"] .acc-link { color: #cbd5e1; }
[data-theme="dark"] .acc-link:hover,
[data-theme="dark"] .acc-toggle:hover { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .acc-leaf { color: #94a3b8; }
[data-theme="dark"] .nav-links a.active,
[data-theme="dark"] .category-card.active { background: var(--indigo-soft); }
[data-theme="dark"] .product-detail .detail-info .cat-badge { background: var(--indigo-soft); color: var(--primary-light); }
[data-theme="dark"] .header-btn:hover { background: #334155; }
[data-theme="dark"] .search-results .result-item:hover { background: #334155; }

[data-theme="dark"] .order-status.pending { background: var(--amber-soft); color: var(--amber-soft-text); }
[data-theme="dark"] .order-status.paid,
[data-theme="dark"] .order-status.delivered { background: var(--green-soft); color: var(--green-soft-text); }
[data-theme="dark"] .order-status.shipped { background: var(--blue-soft); color: var(--blue-soft-text); }
[data-theme="dark"] .order-status.cancelled { background: var(--red-soft); color: var(--red-soft-text); }

[data-theme="dark"] footer { color: #94a3b8; }
[data-theme="dark"] footer .footer-bottom { border-top-color: #334155; }

[data-theme="dark"] .chat-msg-bubble { background: #334155; }
[data-theme="dark"] .chat-msg.own .chat-msg-bubble { background: var(--blue-soft); }
[data-theme="dark"] .chat-input-wrap input { background: var(--surface); color: var(--gray-600); }

/* redesigned surfaces → neutral slate in dark */
[data-theme="dark"] body {
  background:
    radial-gradient(900px 380px at 85% -5%, rgba(59, 130, 246, 0.07), transparent 60%),
    radial-gradient(700px 320px at 0% 30%, rgba(37, 99, 235, 0.05), transparent 60%),
    linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
}
[data-theme="dark"] .category-section { background: linear-gradient(180deg, #182234 0%, transparent 100%); }
[data-theme="dark"] .products-section { background: linear-gradient(180deg, transparent 0%, #182234 100%); }
[data-theme="dark"] .about-home-section { background: linear-gradient(180deg, #182234 0%, #141c2e 100%); }
[data-theme="dark"] .process-section { background: linear-gradient(180deg, #1a2438 0%, #182234 100%); }

[data-theme="dark"] .category-card,
[data-theme="dark"] a.category-card {
  background: linear-gradient(180deg, #1e293b 0%, #182234 100%);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .category-card:hover {
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .category-card.active {
  background: linear-gradient(160deg, var(--indigo-soft), var(--blue-soft));
  border-color: transparent;
}

[data-theme="dark"] .product-card {
  background: linear-gradient(180deg, #1e293b 0%, #182234 100%);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .product-card:hover {
  box-shadow: 0 22px 48px -14px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .product-card .img-wrap { background: linear-gradient(180deg, #182234, #141c2e); }
[data-theme="dark"] .product-card .img-wrap:has(.placeholder-icon) { background: linear-gradient(170deg, #1a2438 0%, #16223a 100%); }

[data-theme="dark"] #sort-select,
[data-theme="dark"] .filter-sort-bar select {
  background: linear-gradient(180deg, #1e293b, #182234);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .category-tabs .tab {
  background: linear-gradient(180deg, #1e293b, #182234);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.4);
}

/* ── Theme Toggle (animated sun/moon circle) ── */
#theme-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--gray-100);
  border-radius: 50%;
  color: var(--gray-600);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#theme-toggle i {
  font-size: 19px;
  color: var(--warning);
  animation: themeIconPop 0.45s ease;
}
#theme-toggle:hover {
  background: var(--blue-soft);
  border-color: var(--blue-soft-border);
  color: var(--primary);
}
#theme-toggle.pulse { animation: themeBtnPulse 0.55s ease; }
@keyframes themeIconPop {
  0% { transform: rotate(-120deg) scale(0.3); opacity: 0; }
  60% { transform: rotate(12deg) scale(1.25); opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}
@keyframes themeBtnPulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); }
  100% { box-shadow: 0 0 0 16px rgba(59, 130, 246, 0); }
}
[data-theme="dark"] #theme-toggle {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] #theme-toggle i { color: #93c5fd; }
[data-theme="dark"] #theme-toggle:hover { background: #334155; color: #fff; }

.admin-sidebar #theme-toggle {
  margin: -8px 16px 14px;
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}
.admin-sidebar #theme-toggle:hover { background: #475569; color: #fff; }



/* ══════════ Animations & Transitions ══════════ */
html { scroll-behavior: smooth; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  /* page-load entrance */
  .hero h1, .hero p, .hero-btn { animation: fadeUp .6s ease both; }
  .hero p { animation-delay: .12s; }
  .hero-btn { animation-delay: .24s; }

  .section-title { animation: fadeUp .55s ease both; }

  .product-grid .product-card,
  .category-grid .category-card,
  .services-grid > div,
  .sellers-grid > div { animation: fadeUp .5s ease both; }
  .product-grid .product-card:nth-child(2),
  .category-grid .category-card:nth-child(2) { animation-delay: .05s; }
  .product-grid .product-card:nth-child(3),
  .category-grid .category-card:nth-child(3) { animation-delay: .1s; }
  .product-grid .product-card:nth-child(4),
  .category-grid .category-card:nth-child(4) { animation-delay: .15s; }
  .product-grid .product-card:nth-child(5),
  .category-grid .category-card:nth-child(5) { animation-delay: .2s; }
  .product-grid .product-card:nth-child(6),
  .category-grid .category-card:nth-child(6) { animation-delay: .25s; }
  .product-grid .product-card:nth-child(7),
  .category-grid .category-card:nth-child(7) { animation-delay: .3s; }
  .product-grid .product-card:nth-child(8),
  .category-grid .category-card:nth-child(8) { animation-delay: .35s; }

  .loyalty-banner, #seller-banner, #partner-banner { animation: fadeUp .6s ease both; }

  /* hover polish */
  .btn-primary, .btn-outline, .btn-sm, .btn-delete {
    transition: transform .18s ease, box-shadow .18s ease, background .25s ease, color .25s ease, border-color .25s ease;
  }
  .btn-primary:hover, .btn-outline:hover, .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.5);
  }
  .btn-primary:active, .btn-outline:active, .btn-sm:active {
    transform: translateY(0);
    box-shadow: none;
  }

  .nav-links a { position: relative; }
  .nav-links a::after {
    content: '';
    position: absolute;
    right: 12px;
    left: 12px;
    bottom: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s ease;
  }
  .nav-links a:hover::after,
  .nav-links a.active::after { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════ Scroll-Reveal (homepage) ══════════ */
body.js-reveal .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
body.js-reveal .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
body.js-reveal .process-steps .reveal:nth-child(2) { transition-delay: .08s; }
body.js-reveal .process-steps .reveal:nth-child(3) { transition-delay: .16s; }
body.js-reveal .process-steps .reveal:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  body.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .idea-person { opacity: 1; transform: none; transition: none; }
}
