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

:root {
  --accent: #ff4d2e;
  --ink: #f4f2ee;
  --dim: #9a9591;
  --line: rgba(244, 242, 238, 0.12);
  --nav-h: 72px;
}

html, body {
  width: 100%;
  background: #000;
  color: var(--ink);
  font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
}

body {
  overflow-x: hidden;
}

/* ---------- Themed scrollbars (site-wide) ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #0a0a0a;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 999px;
  border: 2px solid #0a0a0a;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

a { color: inherit; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding-inline: clamp(20px, 5vw, 56px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-solid,
.site-header.is-scrolled {
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand img { display: block; }

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  list-style: none;
  white-space: nowrap;
}

.nav-links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.account-link,
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.account-link:hover,
.cart-link:hover {
  border-color: var(--ink);
  background: rgba(244, 242, 238, 0.08);
}

.account-link.is-signed-in {
  border-color: var(--accent);
  color: var(--accent);
}

.cart-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 10.5px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-badge.visible { display: inline-flex; }

.nav-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
  border: none;
  cursor: pointer;
}

.nav-cta:hover { filter: brightness(1.08); }
.nav-cta:active { transform: scale(0.97); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; flex-shrink: 0; }
}

/* ---------- Mobile nav panel (built by common.js's initMobileNav) ---------- */

.mobile-nav-panel { display: none; }

@media (max-width: 760px) {
  .mobile-nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: rgba(6, 6, 6, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 4px clamp(20px, 5vw, 56px) 24px;
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
  }

  .site-header.nav-open .mobile-nav-panel { display: block; }

  .mobile-nav-panel .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .mobile-nav-panel .nav-links li { width: 100%; }

  .mobile-nav-panel .nav-links a {
    display: block;
    width: 100%;
    padding: 15px 2px;
    font-size: 15.5px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav-panel .nav-cta {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
  }
}

/* ---------- Product card (shared by home slider + shop grid) ---------- */

.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.product-card:hover .product-media img {
  transform: scale(1.04);
}

.product-category-tag {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: rgba(10, 10, 10, 0.72);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.product-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.product-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
  padding: 72px clamp(20px, 5vw, 56px) 28px;
}

.footer-inner {
  max-width: 1400px;
  margin-inline: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
}

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 36px; }
}

@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; }
}

.footer-brand .brand { margin-bottom: 14px; }

.footer-tagline {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.9;
  max-width: 34ch;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-social a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  color: var(--dim);
  font-size: 13px;
}

.footer-legal {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-legal a {
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
}

.footer-legal a:hover { color: var(--ink); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
