/* ── Vazirmatn self-hosted ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:        #F8F4FC;
  --violet:    #2D1B69;
  --violet-mid:#4A2F9A;
  --violet-lt: #7B5EA7;
  --rose:      #E8A0BF;
  --rose-dk:   #D4789E;
  --white:     #ffffff;
  --card-sh:   0 4px 24px rgba(45,27,105,.10);
  --card-sh-hv:0 8px 32px rgba(45,27,105,.18);
  --radius:    12px;
  --radius-sm: 8px;
  --fs-xs:     0.75rem;
  --fs-sm:     0.875rem;
  --fs-base:   1rem;
  --fs-lg:     1.125rem;
  --fs-xl:     1.375rem;
  --fs-2xl:    1.75rem;
  --fs-3xl:    2.25rem;
  --lh:        1.8;
  --trans:     .2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: #1a1025;
  line-height: var(--lh);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Top bar ────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--violet);
  color: rgba(255,255,255,.75);
  font-size: var(--fs-xs);
  padding: 6px 0;
  text-align: center;
}
.topbar a { color: var(--rose); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(45,27,105,.08);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* logo right, nav center, actions left */
.logo {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--violet);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--rose-dk); }

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.main-nav a {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #3d2868;
  transition: background var(--trans), color var(--trans);
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--violet);
  color: var(--white);
}

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

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--violet);
  transition: background var(--trans);
  position: relative;
}
.btn-icon:hover { background: var(--bg); }

.cart-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--rose-dk);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* mobile hamburger */
.btn-menu {
  display: none;
  border: none;
  background: none;
  color: var(--violet);
  padding: 4px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(45,27,105,.75) 0%, rgba(45,27,105,.35) 50%, transparent 100%);
}

.hero-content {
  position: absolute;
  top: 50%;
  right: 8%;
  transform: translateY(-50%);
  max-width: 440px;
  color: #fff;
}

.hero-content h1 {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hero-content p {
  font-size: var(--fs-base);
  opacity: .88;
  margin-bottom: 28px;
  line-height: 1.9;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rose-dk);
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 700;
  padding: 13px 32px;
  border-radius: 30px;
  border: none;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  box-shadow: 0 4px 16px rgba(212,120,158,.4);
}
.btn-primary:hover {
  background: #c0608a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,120,158,.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 24px;
  border: none;
  transition: background var(--trans), transform var(--trans);
}
.btn-secondary:hover {
  background: var(--violet-mid);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--violet);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 24px;
  border: 2px solid var(--violet);
  transition: background var(--trans), color var(--trans);
}
.btn-outline:hover {
  background: var(--violet);
  color: #fff;
}

/* ── Section shared ──────────────────────────────────────────────────────── */
.section {
  padding: 72px 0;
}

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-head {
  text-align: center;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 8px;
}

.section-head p {
  color: #6b5a8a;
  font-size: var(--fs-sm);
}

.section-divider {
  width: 56px;
  height: 4px;
  background: linear-gradient(to left, var(--rose), var(--violet-lt));
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ── Categories strip ────────────────────────────────────────────────────── */
.categories {
  background: var(--white);
  padding: 48px 0;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 2px solid transparent;
  transition: border-color var(--trans), box-shadow var(--trans), transform var(--trans);
  cursor: pointer;
  text-decoration: none;
  color: var(--violet);
}

.cat-card:hover {
  border-color: var(--violet-lt);
  box-shadow: 0 4px 20px rgba(123,94,167,.2);
  transform: translateY(-3px);
}

.cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ede5f8 0%, #f8f0fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet-mid);
  flex-shrink: 0;
}

.cat-card span {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
}

/* ── Products grid ───────────────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--trans), transform var(--trans);
}

.product-card:hover {
  box-shadow: var(--card-sh-hv);
  transform: translateY(-4px);
}

.product-card__img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f0fb;
}

.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.product-card:hover .product-card__img img {
  transform: scale(1.06);
}

.product-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card__cat {
  font-size: var(--fs-xs);
  color: var(--violet-lt);
  font-weight: 500;
}

.product-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #1a1025;
  line-height: 1.5;
}

.product-card__price {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--violet);
  margin-top: auto;
}

.btn-add-cart {
  width: 100%;
  background: linear-gradient(135deg, #2fa35a 0%, #24874a 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: inherit;
  transition: opacity var(--trans), transform var(--trans);
  margin-top: 8px;
}
.btn-add-cart:hover {
  opacity: .9;
  transform: translateY(-1px);
}

/* ── Trust bar ───────────────────────────────────────────────────────────── */
.trust-bar {
  background: var(--violet);
  padding: 48px 0;
}

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

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-align: center;
}

.trust-item__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose);
}

.trust-item__title {
  font-size: var(--fs-base);
  font-weight: 700;
}

.trust-item__desc {
  font-size: var(--fs-xs);
  opacity: .7;
  line-height: 1.6;
}

/* ── Blog cards ──────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--trans), transform var(--trans);
}

.blog-card:hover {
  box-shadow: var(--card-sh-hv);
  transform: translateY(-3px);
}

.blog-card__img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.blog-card:hover .blog-card__img img {
  transform: scale(1.05);
}

.blog-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-card__tag {
  display: inline-block;
  background: #f0eafc;
  color: var(--violet-mid);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}

.blog-card__title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: #1a1025;
  line-height: 1.6;
}

.blog-card__excerpt {
  font-size: var(--fs-sm);
  color: #6b5a8a;
  flex: 1;
}

.blog-card__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--violet-mid);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  transition: color var(--trans);
}
.blog-card__link:hover { color: var(--rose-dk); }

/* ── Gallery mosaic ──────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 220px);
  gap: 16px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.gallery-item:hover img {
  transform: scale(1.07);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(45,27,105,.0);
  transition: background var(--trans);
}

.gallery-item:hover::after {
  background: rgba(45,27,105,.12);
}

/* ── Newsletter ──────────────────────────────────────────────────────────── */
.newsletter {
  background: linear-gradient(135deg, #3a2280 0%, var(--violet) 100%);
  padding: 64px 0;
  text-align: center;
}

.newsletter h2 {
  color: #fff;
  font-size: var(--fs-2xl);
  margin-bottom: 10px;
}

.newsletter p {
  color: rgba(255,255,255,.75);
  font-size: var(--fs-sm);
  margin-bottom: 28px;
}

.newsletter-form {
  display: flex;
  flex-direction: row;      /* input + button share ONE horizontal axis */
  direction: rtl;           /* RTL: first item (input) sits on the RIGHT, button flush on its LEFT */
  align-items: stretch;     /* both children resolve to the exact same height */
  justify-content: center;
  gap: 0;                   /* no gap: the two pills read as a single joined field */
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1 1 auto;           /* input grows to fill the field... */
  min-width: 0;             /* ...and may shrink below its intrinsic width */
  order: 1;                 /* explicit RTL order: input first → right side */
  padding: 14px 18px;
  border: none;
  /* Mirrored radius: rounded on the OUTER (right/start) edge, square where it butts
     the button. Logical corners resolve correctly against the RTL box. */
  border-start-start-radius: var(--radius);
  border-end-start-radius: var(--radius);
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.5;
  outline: none;
  background: rgba(255,255,255,.96);
  /* RTL box + right-aligned content: the Persian placeholder reads right-to-left and
     sits flush right, while a typed e-mail address still reads left-to-right. */
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.newsletter-form button {
  flex: 0 0 auto;           /* keeps its natural width, never shrinks */
  order: 2;                 /* explicit RTL order: button second → left side */
  background: var(--rose-dk);
  color: #fff;
  border: none;
  /* Mirrored radius: rounded on the OUTER (left/end) edge, square where it meets the input. */
  border-start-end-radius: var(--radius);
  border-end-end-radius: var(--radius);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  padding: 14px 24px;
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.5;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--trans);
}
.newsletter-form button:hover { background: #c0608a; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--violet);
  color: rgba(255,255,255,.8);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-logo {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: block;
}
.footer-logo span { color: var(--rose); }

.footer-desc {
  font-size: var(--fs-sm);
  line-height: 1.9;
  opacity: .7;
  margin-bottom: 20px;
}

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

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
  transition: background var(--trans), color var(--trans);
}

.footer-social a:hover {
  background: var(--rose-dk);
  color: #fff;
}

.footer-col h4 {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,.65);
  transition: color var(--trans);
}

.footer-col ul li a:hover { color: var(--rose); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: var(--fs-sm);
  color: rgba(255,255,255,.65);
}

.footer-contact-item svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--rose);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 24px;
  text-align: center;
  font-size: var(--fs-xs);
  color: rgba(255,255,255,.4);
}

/* ── Flash / alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success {
  background: #edf9f0;
  border-color: #b2e4c2;
  color: #1e6b3e;
}
.alert-error {
  background: #fff0f3;
  border-color: #f5b8c4;
  color: #9b1c36;
}

/* ── Mobile nav overlay ───────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45,27,105,.97);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  color: #fff;
  font-size: var(--fs-xl);
  font-weight: 700;
  transition: color var(--trans);
}

.mobile-nav a:hover { color: var(--rose); }

.mobile-nav-close {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 32px;
  cursor: pointer;
}

/* ── Stub page ───────────────────────────────────────────────────────────── */
.stub-wrap {
  max-width: 700px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.stub-wrap h1 {
  font-size: var(--fs-2xl);
  color: var(--violet);
  margin-bottom: 12px;
}

.stub-wrap p {
  color: #6b5a8a;
  font-size: var(--fs-sm);
  margin-bottom: 28px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .product-grid  { grid-template-columns: repeat(2, 1fr); }
  .cat-grid      { grid-template-columns: repeat(3, 1fr); }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav      { display: none; }
  .btn-menu      { display: flex; }

  .hero { height: 400px; }
  .hero-content { right: 5%; max-width: 85%; }
  .hero-content h1 { font-size: var(--fs-xl); }

  .section { padding: 48px 0; }

  .cat-grid     { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .trust-grid   { grid-template-columns: repeat(2, 1fr); }
  .blog-grid    { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
  .footer-grid  { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 16px; gap: 12px; }
  .hero { height: 300px; }
  .cat-grid     { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .trust-grid   { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .section-inner { padding: 0 16px; }
}

/* ── Stage 2: shop / product / cart / checkout / auth / account ───────────── */

/* Shop category filter */
.shop-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.shop-filter a {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #3d2868;
  border: 2px solid #ddd5f3;
  background: var(--white);
  white-space: nowrap;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.shop-filter a:hover,
.shop-filter a.active,
.shop-filter__pill--active {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
}

/* Quantity stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid #ddd5f3;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-stepper button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  color: var(--violet);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans);
}
.qty-stepper button:hover { background: #e8dff5; }
.qty-stepper input[type=number] {
  width: 52px;
  text-align: center;
  border: none;
  border-right: 1px solid #ddd5f3;
  border-left: 1px solid #ddd5f3;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--violet);
  height: 36px;
  outline: none;
  background: #fff;
  -moz-appearance: textfield;
}
.qty-stepper input[type=number]::-webkit-outer-spin-button,
.qty-stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Size selector */
.size-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.size-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 2px solid #ddd5f3;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--violet);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans), color var(--trans);
}
.size-btn:hover  { border-color: var(--violet-lt); }
.size-btn.selected { border-color: var(--violet); background: var(--violet); color: #fff; }

/* Reusable form utilities */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--violet);
}
.form-input {
  padding: 12px 16px;
  border: 1.5px solid #ddd5f3;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  outline: none;
  background: #fff;
  color: #1a1025;
  transition: border-color var(--trans), box-shadow var(--trans);
  width: 100%;
}
.form-input:focus {
  border-color: var(--violet-lt);
  box-shadow: 0 0 0 3px rgba(123,94,167,.1);
}
textarea.form-input { resize: vertical; min-height: 100px; }

/* Cart layout */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
.cart-items-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  overflow: hidden;
}
.cart-table {
  width: 100%;
  border-collapse: collapse;
}
.cart-table th {
  text-align: right;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--violet);
  padding: 14px 20px;
  background: #f5f0fb;
  white-space: nowrap;
}
.cart-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #f5f0fb;
  vertical-align: middle;
  font-size: var(--fs-sm);
  color: #1a1025;
}
.cart-table tr:last-child td { border-bottom: none; }
.cart-product-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}
.cart-product-name {
  font-weight: 600;
  color: #1a1025;
}
.cart-remove {
  background: none;
  border: none;
  color: var(--rose-dk);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--trans);
  line-height: 1;
}
.cart-remove:hover { background: #fff0f3; }
.cart-summary {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  padding: 24px;
  position: sticky;
  top: 90px;
}
.cart-summary h3 {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0eafc;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  padding: 10px 0;
  color: #4a3a6a;
}
.cart-summary-row.total {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--violet);
  border-top: 2px solid #f0eafc;
  margin-top: 8px;
  padding-top: 14px;
}
.cart-empty {
  text-align: center;
  padding: 64px 24px;
  color: #6b5a8a;
}
.cart-empty svg { margin: 0 auto 16px; display: block; opacity: .3; }
.cart-empty p { font-size: var(--fs-sm); margin-bottom: 20px; }

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
.checkout-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  padding: 28px;
}
.checkout-card h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0eafc;
}

/* Auth pages */
.auth-wrap {
  max-width: 460px;
  margin: 60px auto;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  padding: 36px 32px;
}
.auth-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--violet);
  text-align: center;
  margin-bottom: 28px;
}
.auth-links {
  text-align: center;
  font-size: var(--fs-sm);
  color: #6b5a8a;
  margin-top: 20px;
}
.auth-links a {
  color: var(--violet-mid);
  font-weight: 600;
}
.auth-links a:hover { color: var(--rose-dk); text-decoration: underline; }

/* Account */
.account-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.account-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  overflow: hidden;
}
.account-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #3d2868;
  border-bottom: 1px solid #f0eafc;
  transition: background var(--trans), color var(--trans);
}
.account-sidebar a:last-child { border-bottom: none; }
.account-sidebar a:hover,
.account-sidebar a.active { background: var(--violet); color: #fff; }
.account-main {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  padding: 28px;
}
.account-main h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--violet);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0eafc;
}
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0eafc;
  font-size: var(--fs-sm);
}
.order-row:last-child { border-bottom: none; }
.order-status {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.status-pending   { background: #fff8e6; color: #8a6200; }
.status-paid      { background: #edf9f0; color: #1e6b3e; }
.status-shipped   { background: #e6f0ff; color: #1a4e8a; }
.status-done      { background: #f0eafc; color: var(--violet-mid); }
.status-cancelled { background: #fff0f3; color: #9b1c36; }

/* Order tracking steps */
.tracking-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-sh);
  padding: 28px;
  margin-bottom: 24px;
}
.tracking-steps {
  display: flex;
  gap: 0;
  margin: 24px 0;
  position: relative;
}
.tracking-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.tracking-step::after {
  content: '';
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #e8dff5;
  z-index: 0;
}
.tracking-step:first-child::after { display: none; }
.tracking-step__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8dff5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #9b8ab8;
  font-weight: 700;
}
.tracking-step.done .tracking-step__dot    { background: var(--violet); color: #fff; }
.tracking-step.current .tracking-step__dot { background: var(--rose-dk); color: #fff; }
.tracking-step__label { font-size: var(--fs-xs); color: #6b5a8a; font-weight: 500; }
.tracking-step.done .tracking-step__label,
.tracking-step.current .tracking-step__label { color: var(--violet); font-weight: 600; }

/* 404 */
.page-404 { text-align: center; padding: 80px 24px 100px; }
.page-404 .err-num {
  font-size: 7rem;
  font-weight: 700;
  color: var(--violet);
  opacity: .1;
  line-height: 1;
  margin-bottom: -8px;
}
.page-404 h1  { font-size: var(--fs-2xl); color: var(--violet); margin-bottom: 12px; }
.page-404 p   { color: #6b5a8a; font-size: var(--fs-sm); margin-bottom: 28px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Stage 2 responsive */
@media (max-width: 900px) {
  .cart-layout,
  .checkout-layout { grid-template-columns: 1fr; }
  .account-layout  { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cart-table th:nth-child(3),
  .cart-table td:nth-child(3) { display: none; }
  .auth-card { padding: 24px 20px; }
  .auth-wrap { margin: 32px auto; }
}
@media (max-width: 640px) {
  .cart-table th:nth-child(4),
  .cart-table td:nth-child(4) { display: none; }
}

/* QA cart card layout — zero horizontal overflow, no hidden data */
@media (max-width: 768px) {
  .cart-layout { grid-template-columns: 1fr !important; }
  .cart-table, .cart-table tbody, .cart-table tr { display: block !important; width: 100%; }
  .cart-table thead { display: none !important; }
  .cart-table tr { border: 1px solid rgba(128,128,128,.28); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
  .cart-table td { display: flex !important; border: 0; padding: 6px 0; text-align: right !important; align-items: center; justify-content: space-between; gap: 12px; width: 100% !important; }
  .cart-table td:first-child { display: block !important; }
  .cart-table td:nth-child(2)::before { content: "قیمت واحد"; font-weight: 700; color: #888; font-size: .82rem; flex: none; }
  .cart-table td:nth-child(3)::before { content: "تعداد"; font-weight: 700; color: #888; font-size: .82rem; flex: none; }
  .cart-table td:nth-child(4)::before { content: "جمع"; font-weight: 700; color: #888; font-size: .82rem; flex: none; }
}
