/* ═══════════════════════════════════════════════
   DESIGN TOKENS — Crimson & Ivory (Nakhita)
   ═══════════════════════════════════════════════ */
:root {
  --bg: #EDEBDE;
  --surface: #ffffff;
  --fg: #1B1716;
  --fg-soft: #3d3634;
  --muted: #7a7270;
  --border: #d8d5cc;
  --accent: #810100;
  --accent-hover: #630102;
  --accent-light: #f3e8e8;
  --accent-surface: #f9f0ef;
  --surface-raised: #faf9f6;

  --font-body: 'Vazirmatn', system-ui, -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1200px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
}
@media (min-width: 768px) {
  .section { padding: var(--space-2xl) 0; }
}

/* ═══════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(237, 235, 222, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.navbar-brand span { color: var(--accent); }
.navbar-links {
  display: none;
  list-style: none;
  gap: var(--space-lg);
}
.navbar-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-soft);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}
.navbar-links a:hover { color: var(--accent); }
.navbar-links a.active { color: var(--accent); font-weight: 700; }
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.navbar-actions button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--fg);
  transition: background var(--transition);
}
.navbar-actions button:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.navbar-actions svg { width: 20px; height: 20px; }

/* ── Hamburger button (mobile only) ────────── */
.mobile-menu-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--transition);
}
.mobile-menu-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.mobile-menu-btn svg { width: 20px; height: 20px; }
.mobile-menu-btn .icon-close { display: none; }
.mobile-menu-btn.is-open .icon-hamburger { display: none; }
.mobile-menu-btn.is-open .icon-close { display: block; }

@media (min-width: 768px) {
  .navbar-actions .mobile-menu-btn { display: none; }
}
.cart-badge { position: relative; }
.cart-badge .badge {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

@media (min-width: 768px) {
  .navbar-links { display: flex; }
}

/* ═══════════════════════════════════════════════
   MOBILE MENU
   ═══════════════════════════════════════════════ */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-overlay.is-open {
  display: block;
  opacity: 1;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;  /* RTL: slide from right */
  width: 280px;
  height: 100dvh;
  background: var(--surface);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 80px var(--space-lg) var(--space-xl);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}
.mobile-nav.is-open {
  transform: translateX(0);
}
.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.mobile-nav-links a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg-soft);
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

@media (min-width: 768px) {
  .mobile-overlay,
  .mobile-nav { display: none !important; }
}

body.drawer-open .mobile-nav { z-index: 1001; }
body.drawer-open .mobile-overlay { z-index: 997; }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  background: var(--fg);
  color: #fff;
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}
@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand .brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}
.footer-brand .brand-name span { color: #e8a0a0; }
.footer-brand p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  max-width: 300px;
}
.footer h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: rgba(255,255,255,0.9);
}
.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer ul a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}
.footer ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: right;
  }
}
.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}
.footer-payments {
  display: flex;
  gap: 8px;
}
.footer-payments span {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.01em;
}
.footer-social {
  display: flex;
  gap: var(--space-sm);
}
.footer-social a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
}
.footer-social a:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.footer-social svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); transition: color var(--transition); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; opacity: 0.5; }

/* ═══════════════════════════════════════════════
   PRODUCT CARDS (shared)
   ═══════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(129, 1, 0, 0.1);
}
.product-card .card-img {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--accent-light);
  overflow: hidden;
}
.product-card .card-img .placeholder-img {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--accent);
}
.product-card .card-img .placeholder-img svg { width: 36px; height: 36px; opacity: 0.2; }
.product-card .card-img .placeholder-img span { font-size: 0.75rem; font-weight: 500; opacity: 0.35; }
.product-card:nth-child(odd) .card-img {
  background: linear-gradient(135deg, #f3e0e0 0%, #e8d4d4 100%);
}
.product-card:nth-child(even) .card-img {
  background: linear-gradient(135deg, #ede5dd 0%, #ddd4cc 100%);
}
.product-card .card-img .tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.product-card .card-img .tag.new {
  background: #2d6a4f;
}
.product-card .card-body {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.product-card .card-body .cat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.product-card .card-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.4;
}
.product-card .card-body .price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
  overflow: hidden;
}
.product-card .card-body .price .current {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card .card-body .price .old {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: line-through;
  white-space: nowrap;
  flex-shrink: 0;
}
.product-card .card-body .rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.product-card .card-body .rating svg { width: 12px; height: 12px; color: #d4a017; }

/* ═══════════════════════════════════════════════
   COMMENT SECTION
   ═══════════════════════════════════════════════ */
.comment-section { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--border); }
.comment-section h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: var(--space-md); }

.comment-form { background: var(--surface); padding: var(--space-md); border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: var(--space-lg); }
.comment-form .form-group { margin-bottom: var(--space-sm); }
.comment-form input, .comment-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 5px; font-family: var(--font-body); }
.comment-form button { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: var(--radius-sm); border: none; cursor: pointer; font-weight: 600; margin-top: 10px; transition: background var(--transition); }
.comment-form button:hover { background: var(--accent-hover); }

.comment-list { list-style: none; padding: 0; }
.comment-item { padding: var(--space-md); border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item .comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment-item .comment-author { font-weight: 700; color: var(--fg); }
.comment-item .comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-item .comment-body { color: var(--fg-soft); line-height: 1.6; }

.success-msg { color: var(--accent); font-weight: 600; margin-top: 10px; display: none; }

/* ═══════════════════════════════════════════════
   CART DRAWER (Left Sidebar)
   ═══════════════════════════════════════════════ */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 23, 22, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--surface);
  z-index: 910;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 40px rgba(0,0,0,0.12);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.cart-drawer.open {
  transform: translateX(0);
}

/* Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-drawer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2d6a4f;
  flex-shrink: 0;
}
.cart-drawer-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}
.cart-drawer-title h3 span {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}
.cart-drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: all var(--transition);
}
.cart-drawer-close:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.cart-drawer-close svg { width: 18px; height: 18px; }

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.cart-drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Cart Items */
.cart-drawer-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
}
.cart-drawer-item:hover {
  background: var(--surface-raised);
}
.cart-drawer-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.cart-drawer-item-img .ph-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-drawer-item-img .ph-img svg {
  width: 24px;
  height: 24px;
  opacity: 0.2;
  color: var(--accent);
}
.cart-drawer-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cart-drawer-item-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.5;
}
.cart-drawer-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
.cart-drawer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.cart-drawer-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-soft);
  background: var(--surface-raised);
  transition: background var(--transition);
}
.qty-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.qty-val {
  width: 32px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border-inline: 1px solid var(--border);
  line-height: 30px;
}
.cart-drawer-price {
  text-align: left;
}
.cart-drawer-current {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}
.cart-drawer-current small {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
}
.cart-drawer-remove {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  opacity: 0;
  transition: all var(--transition);
}
.cart-drawer-item:hover .cart-drawer-remove {
  opacity: 1;
}
.cart-drawer-remove:hover {
  background: #fde8e8;
  color: #c0392b;
}
.cart-drawer-remove svg { width: 14px; height: 14px; }

/* Cross-sell */
.cart-drawer-crosstitle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}
.cart-drawer-crosstitle svg { color: var(--accent); }
.cart-drawer-crosst {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cross-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.cross-card:hover { border-color: var(--accent); }
.cross-card-img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cross-card-img svg { opacity: 0.2; color: var(--accent); }
.cross-card-info {
  flex: 1;
  min-width: 0;
}
.cross-card-info h5 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}
.cross-price {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}
.cross-price small {
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--muted);
}
.cross-add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.cross-add:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}
.cross-add svg { width: 16px; height: 16px; }

/* Footer */
.cart-drawer-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.cart-drawer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cart-drawer-summary span {
  font-size: 0.85rem;
  color: var(--muted);
}
.cart-drawer-summary strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
}
.cart-drawer-go {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.cart-drawer-go:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(129, 1, 0, 0.2);
}

/* Empty cart */
.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
}
.cart-drawer-empty svg { width: 56px; height: 56px; opacity: 0.15; color: var(--muted); }
.cart-drawer-empty p {
  font-size: 0.9rem;
  color: var(--muted);
}
.cart-drawer-empty a {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background var(--transition);
}
.cart-drawer-empty a:hover { background: var(--accent-hover); }

/* Item remove animation */
.cart-drawer-item.removing {
  opacity: 0;
  transform: translateX(40px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Body scroll lock when drawer open */
body.drawer-open {
  overflow: hidden;
}
