/* ============================================================
   دنجکو — shop.css · فروشگاه
   Styles for the shared shop shell (header/search/footer),
   listing, product detail, cart/checkout, auth and account.
   Builds on tokens defined in style.css.
   ============================================================ */

/* ---------- fonts (shared, so subpages don't repeat them) ---------- */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Light.woff2") format("woff2");  font-weight: 300; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");  font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");    font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Black.woff2") format("woff2");   font-weight: 900; font-display: swap; }

/* ============================================================
   shared shop header
   ============================================================ */
.site-header.shop-header {
  position: sticky; top: 0;
  background: rgba(20, 16, 13, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 194, 174, 0.12);
}
/* home page keeps the floating transparent header */
body.page-home .site-header.shop-header {
  position: fixed; background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom-color: transparent;
}
body.page-home .site-header.scrolled {
  background: rgba(20, 16, 13, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(207, 194, 174, 0.12);
}

.header-inner { flex-wrap: wrap; row-gap: 0.55rem; }
.header-inner .brand { flex: none; }
.header-inner .main-nav { margin-inline-start: 0.4rem; }

/* search */
.header-search {
  flex: 1 1 260px; max-width: 560px;
  display: flex; align-items: center;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.16);
  border-radius: var(--radius-pill);
  transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
}
.header-search:focus-within { border-color: var(--copper); background: var(--ink-900); }
.header-search .search-btn {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; color: var(--sand-400);
  transition: color 0.2s;
}
.header-search .search-btn:hover { color: var(--copper); }
.header-search .search-btn svg { width: 18px; height: 18px; }
.header-search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--cream); font: inherit; font-size: 0.92rem;
  padding-inline-end: 1rem;
}
.header-search input::placeholder { color: var(--sand-400); }

/* action buttons */
.header-actions { display: flex; align-items: center; gap: 0.55rem; margin-inline-start: auto; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.55rem;
  width: 44px; height: 44px; justify-content: center;
  border-radius: var(--radius-s);
  color: var(--sand-200);
  border: 1px solid transparent;
  transition: color 0.2s, background-color 0.25s var(--ease-out), border-color 0.25s;
}
.icon-btn:hover { color: var(--copper); background: var(--copper-soft); border-color: rgba(224, 133, 67, 0.3); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.account-chip {
  width: auto; padding-inline: 0.9rem; font-weight: 700; font-size: 0.88rem;
}
.icon-btn.account-chip svg { width: 18px; height: 18px; color: var(--copper); }
.cart-count {
  position: absolute; top: 2px; inset-inline-end: 2px;
  min-width: 18px; height: 18px; padding-inline: 4px;
  display: grid; place-items: center;
  background: var(--copper); color: var(--ink-950);
  font-size: 0.68rem; font-weight: 900; line-height: 1;
  border-radius: var(--radius-pill);
}

/* ============================================================
   subpage scaffolding
   ============================================================ */
.page-head { padding-block: 2.6rem 0.4rem; }
.page-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 900; line-height: 1.5; }
.page-head .sub { color: var(--sand-400); font-size: 0.92rem; margin-top: 0.3rem; }

.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  padding-block: 1.4rem 0; font-size: 0.82rem; color: var(--sand-400);
}
.breadcrumbs a { transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--copper); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs [aria-current] { color: var(--cream); font-weight: 600; }

/* ============================================================
   product card (shared everywhere)
   ============================================================ */
.p-card-link { display: block; }
.product-card .product-figure .p-img-link { position: absolute; inset: 0; z-index: 1; }
.product-card h3 a { transition: color 0.2s; }
.product-card h3 a:hover { color: var(--copper); }
.price-discount {
  background: #ef4056; color: #fff;
  font-size: 0.74rem; font-weight: 800;
  padding: 0.14rem 0.5rem; border-radius: var(--radius-pill);
}
.stock-out .product-figure img { filter: grayscale(0.85); opacity: 0.75; }
.stock-out .badge { background: var(--sand-400); }

/* quick-add stays visible on touch devices */
@media (hover: none) {
  .product-quick { opacity: 1; translate: 0 0; }
}

/* ============================================================
   horizontal carousel (Digikala-style rows)
   direction is flipped to LTR inside the track so native
   scrolling and snap behave predictably; cards stay RTL.
   ============================================================ */
.h-carousel { position: relative; }
.h-track {
  direction: ltr;
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 270px);
  gap: 1.1rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 0.6rem;
  scrollbar-width: none;
}
.h-track::-webkit-scrollbar { display: none; }
.h-track > * { direction: rtl; scroll-snap-align: start; }

/* carousel row head */
.row-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.3rem;
}
.row-head .kicker { font-size: 0.9rem; }
.row-head h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 900; line-height: 1.5; margin-top: 0.4rem; }
.row-head .h-nav { margin-bottom: 0; }

.btn-sm { padding: 0.55rem 1.35rem; font-size: 0.88rem; }

/* warm band behind the deals row */
.deals-section {
  background: linear-gradient(var(--ink-900) 0%, var(--ink-950) 100%);
  border-block: 1px solid rgba(207, 194, 174, 0.08);
  padding-block: clamp(3rem, 7vw, 5rem);
}
.h-nav {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-bottom: 0.9rem;
}
.h-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(207, 194, 174, 0.22);
  color: var(--sand-200);
  display: grid; place-items: center;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.15s;
}
.h-btn:hover { background: var(--copper); border-color: var(--copper); color: var(--ink-950); }
.h-btn:active { transform: scale(0.94); }
.h-btn svg { width: 18px; height: 18px; }
.h-btn[disabled] { opacity: 0.35; pointer-events: none; }

/* ============================================================
   listing page
   ============================================================ */
.listing-layout {
  display: grid; grid-template-columns: 270px 1fr;
  gap: 1.6rem; align-items: start;
  padding-block: 1.4rem 4rem;
}

.filter-panel {
  position: sticky; top: 92px;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: 1.3rem 1.4rem;
}
.filter-panel h3 {
  font-size: 0.95rem; font-weight: 900;
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.9rem; margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(207, 194, 174, 0.1);
}
.filter-panel h3 svg { width: 17px; height: 17px; color: var(--copper); }
.filter-group { margin-bottom: 1.25rem; }
.filter-group > b { display: block; font-size: 0.85rem; font-weight: 800; margin-bottom: 0.6rem; }
.filter-group label.check {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.88rem; color: var(--sand-200);
  padding-block: 0.32rem; cursor: pointer;
  transition: color 0.2s;
}
.filter-group label.check:hover { color: var(--cream); }
.filter-group input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--copper); cursor: pointer;
}
.filter-group .count { color: var(--sand-400); font-size: 0.75rem; margin-inline-start: auto; }
.filter-group.cat-list a {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.88rem; color: var(--sand-200);
  padding: 0.4rem 0.55rem; border-radius: var(--radius-s);
  transition: background-color 0.2s, color 0.2s;
}
.filter-group.cat-list a:hover { background: var(--copper-soft); color: var(--cream); }
.filter-group.cat-list a.active { background: var(--copper); color: var(--ink-950); font-weight: 700; }
.filter-group.cat-list a .count { margin-inline-start: auto; color: inherit; opacity: 0.7; }
.price-inputs { display: flex; align-items: center; gap: 0.5rem; }
.price-inputs input {
  width: 100%; background: var(--ink-900);
  border: 1px solid rgba(207, 194, 174, 0.18);
  border-radius: var(--radius-s);
  color: var(--cream); font: inherit; font-size: 0.82rem;
  padding: 0.5rem 0.7rem;
}
.price-inputs input:focus { outline: none; border-color: var(--copper); }
.price-inputs span { color: var(--sand-400); font-size: 0.75rem; flex: none; }
.filter-apply {
  width: 100%; margin-top: 0.7rem;
  background: var(--copper-soft); color: var(--copper);
  border: 1px solid rgba(224, 133, 67, 0.35);
  border-radius: var(--radius-s);
  font-weight: 700; font-size: 0.85rem; padding: 0.55rem;
  transition: background-color 0.25s, color 0.25s;
}
.filter-apply:hover { background: var(--copper); color: var(--ink-950); }

.listing-main { min-width: 0; }
.sort-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: 0.85rem 1.2rem; margin-bottom: 1.3rem;
}
.sort-bar .result-count { font-size: 0.88rem; color: var(--sand-200); }
.sort-bar .result-count b { color: var(--copper); }
.sort-field { display: flex; align-items: center; gap: 0.6rem; margin-inline-start: auto; }
.sort-field label { font-size: 0.85rem; color: var(--sand-400); white-space: nowrap; }
.sort-field select {
  background: var(--ink-900); color: var(--cream);
  border: 1px solid rgba(207, 194, 174, 0.18);
  border-radius: var(--radius-s);
  font: inherit; font-size: 0.85rem;
  padding: 0.5rem 2.2rem 0.5rem 0.9rem;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a89880' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 0.7rem center; background-size: 15px;
}
.sort-field select:focus { outline: none; border-color: var(--copper); }

.active-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.active-chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--copper-soft); border: 1px solid rgba(224, 133, 67, 0.35);
  color: var(--copper); font-size: 0.8rem; font-weight: 600;
  padding: 0.32rem 0.8rem; border-radius: var(--radius-pill);
}
.chip button {
  display: grid; place-items: center; width: 16px; height: 16px;
  color: inherit; border-radius: 50%; font-size: 0.9rem; line-height: 1;
}
.chip button:hover { color: var(--cream); }

.listing-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}

.empty-state {
  text-align: center; padding: 4.5rem 1rem;
  background: var(--ink-800);
  border: 1px dashed rgba(207, 194, 174, 0.25);
  border-radius: var(--radius-m);
}
.empty-state svg { width: 58px; height: 58px; color: var(--sand-400); margin-inline: auto; }
.empty-state h3 { font-size: 1.15rem; font-weight: 800; margin-top: 1rem; }
.empty-state p { color: var(--sand-400); font-size: 0.9rem; margin-top: 0.4rem; }
.empty-state .btn { margin-top: 1.4rem; }

/* ============================================================
   product detail
   ============================================================ */
.pd-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3.4rem);
  padding-block: 1rem 3.5rem;
}
.pd-gallery { position: sticky; top: 92px; align-self: start; }
.pd-main-img {
  position: relative; overflow: hidden;
  border-radius: var(--radius-l);
  background: #f0ebe2;
  aspect-ratio: 1 / 0.85;
  border: 1px solid rgba(207, 194, 174, 0.1);
}
.pd-main-img img {
  width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: multiply;
  transition: opacity 0.3s var(--ease-out);
}
.pd-main-img .badge { top: 1.1rem; inset-inline-start: 1.1rem; font-size: 0.8rem; }
.pd-thumbs { display: flex; gap: 0.7rem; margin-top: 0.8rem; }
.pd-thumbs button {
  width: 74px; height: 74px; overflow: hidden;
  border-radius: var(--radius-s);
  border: 2px solid transparent;
  background: #f0ebe2;
  transition: border-color 0.25s, transform 0.2s;
}
.pd-thumbs button img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.pd-thumbs button.active { border-color: var(--copper); }
.pd-thumbs button:hover { transform: translateY(-2px); }

.pd-brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--copper); font-size: 0.88rem; font-weight: 700;
}
.pd-brand::before { content: ""; width: 22px; height: 2px; background: var(--copper); border-radius: 2px; }
.pd-title { font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 900; line-height: 1.6; margin-top: 0.6rem; }
.pd-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  margin-top: 0.8rem; font-size: 0.86rem; color: var(--sand-400);
}
.pd-meta .rating { margin-top: 0; font-size: 0.86rem; }
.pd-short { color: var(--sand-200); font-weight: 300; margin-top: 1.1rem; }
.pd-points { margin-top: 1.2rem; display: grid; gap: 0.5rem; }
.pd-points li { display: flex; gap: 0.55rem; align-items: flex-start; color: var(--sand-200); font-size: 0.9rem; }
.pd-points svg { width: 18px; height: 18px; flex: none; color: var(--ok); margin-top: 0.3rem; }

/* buy box */
.buy-box {
  margin-top: 1.6rem;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.12);
  border-radius: var(--radius-m);
  padding: 1.5rem 1.6rem;
}
.buy-box .price-line { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.buy-box .price { font-size: 1.7rem; }
.buy-box .price-was { font-size: 0.95rem; }
.buy-box .save-line { color: var(--ok); font-size: 0.82rem; margin-top: 0.3rem; }
.buy-actions { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.2rem; flex-wrap: wrap; }
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid rgba(207, 194, 174, 0.25);
  border-radius: var(--radius-pill);
}
.qty-stepper button {
  width: 44px; height: 46px; font-size: 1.2rem; color: var(--sand-200);
  display: grid; place-items: center; transition: color 0.2s;
}
.qty-stepper button:hover { color: var(--copper); }
.qty-stepper button[disabled] { opacity: 0.3; pointer-events: none; }
.qty-stepper output {
  min-width: 44px; text-align: center; font-weight: 800; font-size: 1.05rem;
}
.buy-box .btn-primary { flex: 1; justify-content: center; min-width: 200px; }
.buy-box .stock-note { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; color: var(--sand-400); font-size: 0.82rem; }
.buy-box .stock-note svg { width: 16px; height: 16px; color: var(--ok); }
.buy-box .stock-note.low { color: var(--warn); }
.buy-box .stock-note.low svg { color: var(--warn); }

/* description + specs */
.pd-body { padding-block: 0 4rem; }
.pd-block {
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  margin-bottom: 1.4rem;
}
.pd-block h2 {
  font-size: 1.2rem; font-weight: 900;
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.pd-block h2::before { content: ""; width: 5px; height: 24px; border-radius: 3px; background: var(--copper); }
.pd-block p { color: var(--sand-200); font-weight: 300; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr + tr { border-top: 1px solid rgba(207, 194, 174, 0.08); }
.spec-table th, .spec-table td { padding: 0.75rem 0.4rem; font-size: 0.92rem; text-align: start; }
.spec-table th { color: var(--sand-400); font-weight: 500; width: 40%; }
.spec-table td { color: var(--cream); font-weight: 600; }

/* ============================================================
   cart & checkout
   ============================================================ */
.cart-layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 1.6rem; align-items: start;
  padding-block: 1.4rem 4rem;
}
.cart-items { display: grid; gap: 1rem; }
.cart-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.1rem; align-items: center;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: 1.1rem 1.2rem;
}
.cart-item .ci-img {
  width: 110px; height: 90px; overflow: hidden;
  border-radius: var(--radius-s); background: #f0ebe2;
}
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.cart-item .ci-info h3 { font-size: 0.98rem; font-weight: 800; line-height: 1.7; }
.cart-item .ci-info h3 a:hover { color: var(--copper); }
.cart-item .ci-info .ci-brand { color: var(--sand-400); font-size: 0.78rem; }
.cart-item .ci-unit { color: var(--sand-400); font-size: 0.82rem; margin-top: 0.3rem; }
.cart-item .ci-side { display: grid; justify-items: end; gap: 0.6rem; }
.cart-item .ci-total { font-weight: 900; color: var(--copper); }
.cart-item .ci-remove {
  color: var(--sand-400); font-size: 0.8rem;
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: color 0.2s;
}
.cart-item .ci-remove:hover { color: #ef4056; }
.cart-item .ci-remove svg { width: 15px; height: 15px; }
.cart-item .qty-stepper button { width: 36px; height: 38px; }
.cart-item .qty-stepper output { min-width: 36px; font-size: 0.95rem; }

.summary-card {
  position: sticky; top: 92px;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.1);
  border-radius: var(--radius-m);
  padding: 1.5rem 1.5rem 1.6rem;
}
.summary-card h2 { font-size: 1.05rem; font-weight: 900; margin-bottom: 1rem; }
.sum-row {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.9rem; color: var(--sand-200);
  padding-block: 0.45rem;
}
.sum-row b { color: var(--cream); font-weight: 700; }
.sum-row.discount b { color: #ef4056; }
.sum-row.free b { color: var(--ok); }
.sum-total {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid rgba(207, 194, 174, 0.12);
  margin-top: 0.7rem; padding-top: 0.9rem;
  font-weight: 900; font-size: 1.05rem;
}
.sum-total b { color: var(--copper); }
.summary-card .btn { width: 100%; justify-content: center; margin-top: 1.1rem; }
.summary-card .sum-note { color: var(--sand-400); font-size: 0.76rem; margin-top: 0.8rem; text-align: center; }

/* checkout form */
.checkout-grid {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 1.6rem; align-items: start;
  padding-block: 1.4rem 4rem;
}
.checkout-form {
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}
.checkout-form h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 1.3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
.radio-group { display: grid; gap: 0.7rem; }
.radio-group label {
  display: flex; align-items: center; gap: 0.7rem;
  border: 1px solid rgba(207, 194, 174, 0.18);
  border-radius: var(--radius-s);
  padding: 0.9rem 1.1rem; cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s;
}
.radio-group label:has(input:checked) {
  border-color: var(--copper); background: var(--copper-soft);
}
.radio-group input { accent-color: var(--copper); width: 17px; height: 17px; }
.radio-group .rg-body b { display: block; font-size: 0.92rem; }
.radio-group .rg-body span { color: var(--sand-400); font-size: 0.78rem; }
.login-hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem;
  background: rgba(217, 164, 65, 0.1);
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: var(--radius-s);
  padding: 0.9rem 1.1rem; margin-bottom: 1.3rem;
  font-size: 0.88rem; color: var(--warn);
}
.login-hint a { color: var(--warn); font-weight: 800; text-decoration: underline; }

/* success */
.success-panel {
  max-width: 620px; margin-inline: auto;
  text-align: center;
  background: var(--ink-800);
  border: 1px solid rgba(127, 176, 105, 0.35);
  border-radius: var(--radius-l);
  padding: clamp(2rem, 5vw, 3.4rem);
}
.success-panel .ok-ring {
  width: 84px; height: 84px; margin-inline: auto;
  border-radius: 50%;
  background: rgba(127, 176, 105, 0.14);
  border: 2px solid var(--ok);
  display: grid; place-items: center; color: var(--ok);
}
.success-panel .ok-ring svg { width: 38px; height: 38px; }
.success-panel h1 { font-size: 1.6rem; font-weight: 900; margin-top: 1.3rem; }
.success-panel p { color: var(--sand-200); margin-top: 0.6rem; }
.success-panel .order-id {
  display: inline-block; margin-top: 1.2rem;
  background: var(--ink-900); border: 1px dashed rgba(207, 194, 174, 0.3);
  border-radius: var(--radius-s);
  padding: 0.6rem 1.4rem; font-weight: 900; letter-spacing: 0.04em;
}
.success-panel .btn { margin-top: 1.6rem; }

/* ============================================================
   auth
   ============================================================ */
.auth-wrap {
  min-height: calc(100dvh - 80px);
  display: grid; place-items: center;
  padding-block: 3rem;
}
.auth-card {
  width: min(430px, 100%);
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.1);
  border-radius: var(--radius-l);
  padding: clamp(1.8rem, 4vw, 2.6rem);
}
.auth-card .brand { justify-content: center; margin-bottom: 1.6rem; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--ink-900);
  border-radius: var(--radius-pill);
  padding: 0.3rem; margin-bottom: 1.6rem;
}
.auth-tabs button {
  padding: 0.6rem; border-radius: var(--radius-pill);
  font-weight: 800; font-size: 0.92rem; color: var(--sand-400);
  transition: background-color 0.25s, color 0.25s;
}
.auth-tabs button[aria-selected="true"] { background: var(--copper); color: var(--ink-950); }
.auth-error {
  background: rgba(239, 64, 86, 0.12);
  border: 1px solid rgba(239, 64, 86, 0.4);
  color: #ff8a97;
  border-radius: var(--radius-s);
  padding: 0.7rem 1rem; font-size: 0.85rem;
  margin-bottom: 1rem;
}
.auth-error:empty { display: none; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.4rem; }
.auth-note { color: var(--sand-400); font-size: 0.78rem; text-align: center; margin-top: 1rem; }

/* ============================================================
   account
   ============================================================ */
.account-layout {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 1.6rem; align-items: start;
  padding-block: 1.4rem 4rem;
}
.profile-card {
  position: sticky; top: 92px;
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: 1.7rem 1.6rem; text-align: center;
}
.profile-card .avatar-big {
  width: 84px; height: 84px; margin-inline: auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--copper-soft); border: 2px solid rgba(224, 133, 67, 0.4);
  color: var(--copper); font-size: 2rem; font-weight: 900;
}
.profile-card h2 { font-size: 1.15rem; font-weight: 900; margin-top: 0.9rem; }
.profile-card .phone { color: var(--sand-400); font-size: 0.88rem; direction: ltr; unicode-bidi: isolate; }
.profile-card .joined { color: var(--sand-400); font-size: 0.76rem; margin-top: 0.5rem; }
.profile-card .logout-btn {
  margin-top: 1.3rem; width: 100%;
  border: 1px solid rgba(239, 64, 86, 0.4);
  color: #ff8a97; border-radius: var(--radius-s);
  padding: 0.6rem; font-weight: 700; font-size: 0.88rem;
  transition: background-color 0.25s, color 0.25s;
}
.profile-card .logout-btn:hover { background: rgba(239, 64, 86, 0.15); }

.orders-list { display: grid; gap: 1.1rem; }
.orders-list h2 { font-size: 1.2rem; font-weight: 900; }
.order-card {
  background: var(--ink-800);
  border: 1px solid rgba(207, 194, 174, 0.09);
  border-radius: var(--radius-m);
  padding: 1.4rem 1.5rem;
}
.order-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem;
  padding-bottom: 0.9rem; margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(207, 194, 174, 0.08);
  font-size: 0.85rem; color: var(--sand-400);
}
.order-head b { color: var(--cream); }
.order-status {
  margin-inline-start: auto;
  background: rgba(217, 164, 65, 0.14);
  border: 1px solid rgba(217, 164, 65, 0.4);
  color: var(--warn);
  font-size: 0.75rem; font-weight: 800;
  padding: 0.2rem 0.7rem; border-radius: var(--radius-pill);
}
.order-items { display: grid; gap: 0.7rem; }
.order-line {
  display: flex; align-items: center; gap: 0.9rem; font-size: 0.88rem;
}
.order-line img {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 8px; background: #f0ebe2; flex: none;
}
.order-line .ol-qty { color: var(--sand-400); font-size: 0.78rem; }
.order-line .ol-price { margin-inline-start: auto; color: var(--sand-200); font-size: 0.84rem; flex: none; }
.order-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; padding-top: 0.9rem;
  border-top: 1px solid rgba(207, 194, 174, 0.08);
  font-size: 0.9rem; color: var(--sand-400);
}
.order-total b { color: var(--copper); font-size: 1.05rem; }

/* ============================================================
   toasts
   ============================================================ */
#toastHost {
  position: fixed; bottom: 1.4rem; inset-inline-start: 50%;
  translate: -50% 0; z-index: 300;
  display: grid; gap: 0.6rem; justify-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink-700);
  border: 1px solid rgba(207, 194, 174, 0.2);
  color: var(--cream);
  font-size: 0.88rem; font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  opacity: 0; translate: 0 14px;
  transition: opacity 0.3s var(--ease-out), translate 0.3s var(--ease-out);
  max-width: min(92vw, 480px); text-align: center;
}
.toast.show { opacity: 1; translate: 0 0; }
.toast-ok { border-color: rgba(127, 176, 105, 0.5); }
.toast-err { border-color: rgba(239, 64, 86, 0.5); }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1024px) {
  .listing-layout { grid-template-columns: 240px 1fr; }
  .pd-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-inner { row-gap: 0.7rem; }
  .header-inner .main-nav { order: 4; }
  .header-search { order: 5; flex-basis: 100%; max-width: none; }
  .header-actions { margin-inline-start: auto; }

  /* anchor the dropdown below the two-row shop header */
  .site-header .main-nav { position: absolute; top: 100%; }

  .listing-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .filter-panel.collapsed .filter-group,
  .filter-panel.collapsed h3 + * { display: none; }
  .filter-toggle-btn { display: inline-flex; }

  .pd-grid { grid-template-columns: 1fr; }
  .pd-gallery { position: static; }

  .cart-layout, .checkout-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .account-layout { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}

@media (min-width: 861px) {
  .filter-toggle-btn { display: none; }
}

@media (max-width: 640px) {
  .icon-btn.account-chip .chip-name { display: none; }
  .icon-btn.account-chip { width: 44px; padding-inline: 0; justify-content: center; }

  .h-track { grid-auto-columns: minmax(200px, 78vw); }

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

  .cart-item {
    grid-template-columns: 84px 1fr;
    grid-template-rows: auto auto;
  }
  .cart-item .ci-img { width: 84px; height: 74px; }
  .cart-item .ci-side {
    grid-column: 1 / -1;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.6rem;
  }
  .form-grid { grid-template-columns: 1fr; }
}

.filter-toggle-btn {
  align-items: center; gap: 0.5rem;
  border: 1px solid rgba(207, 194, 174, 0.25);
  border-radius: var(--radius-s);
  padding: 0.55rem 1rem;
  font-weight: 700; font-size: 0.88rem; color: var(--sand-200);
  margin-bottom: 1rem;
}
.filter-toggle-btn svg { width: 16px; height: 16px; }
