/* اطمینان از حاشیه مناسب در پایین گالری موبایل */
/* ===== Product Detail (clean) ===== */
/* ==== Fix: sidebar filters inputs overflowing ==== */
/* ========== Fix product images in cards ========== */
/* کانتینر کارت قبلاً aspect-ratio:4/5 دارد؛ فقط تصویر را وادار به پرکردن قاب می‌کنیم */
/* ---------- Auth Pages ---------- */
/* ======================================================
   main.css — Clean, Light, Minimal (RTL, Women Fashion)
   ====================================================== */

/* ---------- Base Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { font-family: Vazirmatn, system-ui, sans-serif; line-height: 1.7; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: #ffffff; color: #1f2937;
}

/* ---------- Design Tokens ---------- */
:root{
  /* رنگ‌های زنانه/لطیف */
  --brand: #e91e63;   /* رز */
  --brand-2: #d81b60; /* رز تیره */
  --accent: #ffb7c5;  /* رز خیلی روشن */

  --bg: #ffffff;
  --surface: #f8fafc;   /* طوسی خیلی خیلی روشن */
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;

  --radius: 12px;
  --shadow-sm: 0 6px 18px rgba(233, 30, 99, .08);
}
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.container{ width:100%; max-width:1180px; margin-inline:auto; padding-inline:16px; }
.main{ flex:1; padding-block:32px; }
.grid{ display:grid; gap:16px; }
.grid--2{ grid-template-columns:repeat(2,1fr); }
.grid--3{ grid-template-columns:repeat(3,1fr); }
.grid--4{ grid-template-columns:repeat(4,1fr); }
.muted{ color: var(--muted); }

/* ---------- Header (one-row) ---------- */
.header{ border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar{ display:none; } /* حذف نوار بالا برای خلوتی */

.nav{ position: sticky; top:0; z-index: 50; background: var(--bg); }
.nav__inner{
  display:flex; align-items:center; gap:16px; padding-block:12px;
}
.nav__toggle{ display:none; } /* منوی موبایل با JS فعال می‌شود */
.nav__brand .brand{
  font-weight:900; font-size:1.25rem; letter-spacing:.2px; color:#111827;
}
.nav__search{ flex:1; position:relative; }
.nav__search input{
  width:100%; height:42px; padding:0 14px;
  border:1px solid var(--border); border-radius:999px;
  background:#fff; color:inherit;
}
.search-suggest{
  position:absolute; inset-inline:0; top:110%;
  background:#fff; border:1px solid var(--border); border-radius:10px; padding:6px;
  display:none; box-shadow: var(--shadow-sm);
}
.search-suggest a{ display:block; padding:8px; border-radius:8px; }
.search-suggest a:hover{ background: var(--surface); }

.nav__actions{ display:flex; align-items:center; gap:8px; }
.icon-link{
  width:40px; height:40px; display:grid; place-items:center;
  border:1px solid var(--border); border-radius:10px; background:#fff;
}

/* خط منو – ساده و ظریف */
.nav__bar{ border-top:1px solid var(--border); background: var(--surface); }
.menu{ list-style:none; display:flex; gap:8px; padding:8px 0; margin:0; }
.menu__link{
  padding:8px 10px; border-radius:10px; color:#374151;
}
.menu__link.is-active,
.menu__link:hover{ background:#fff; border:1px solid var(--border); }
.menu__has-sub{ position:relative; }
.submenu{
  position:absolute; inset-inline-start:0; top:100%; min-width:220px;
  background:#fff; border:1px solid var(--border); border-radius:10px; padding:6px; display:none;
  box-shadow: var(--shadow-sm);
}
.menu__has-sub:hover .submenu{ display:block; }
.submenu a{ display:block; padding:8px; border-radius:8px; }
.submenu a:hover{ background: var(--surface); }

/* ---------- Drawer (Cart/Mobile) ---------- */
.drawer{
  position:fixed; inset-block:0; inset-inline-end:0;
  width: clamp(320px, 32vw, 380px);
  background:#fff; border-inline-start:1px solid var(--border);
  transform: translateX(100%); transition: .25s; z-index:60;
  display:flex; flex-direction:column;
}
.drawer[aria-hidden="false"], .drawer.is-open{ transform: translateX(0); }
.drawer__header, .drawer__footer{ padding:14px; border-bottom:1px solid var(--border); }
.drawer__footer{ border-bottom:none; border-top:1px solid var(--border); }
.drawer__body{ padding:14px; overflow:auto; display:grid; gap:12px; }
.drawer-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.35); opacity:0; pointer-events:none; transition:.2s; z-index:59; }
.drawer-backdrop.is-show{ opacity:1; pointer-events:auto; }
body.no-scroll{ overflow:hidden; }

/* ---------- Hero (simple, light) ---------- */
.hero{ background: linear-gradient(135deg, var(--surface), #fff); }
.hero__inner{ display:grid; grid-template-columns:1.05fr .95fr; gap:16px; padding-block:48px; }
.hero__copy h1{ margin:0; font-size: clamp(26px, 4.2vw, 40px); }
.hero__copy p{ margin:.6rem 0 1rem; color: var(--muted); }
.hero__media{ min-height:260px; border-radius: 14px; background:#fff; border:1px solid var(--border); }

/* ---------- Cards / Surfaces ---------- */
.card{ background:#fff; border:1px solid var(--border); border-radius: var(--radius); padding:14px; }
.card--soft{ background: var(--surface); }

/* ---------- Buttons (calm) ---------- */
.btn{
  --h: 42px;
  height: var(--h); padding: 0 14px;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  border-radius:10px; border:1px solid var(--border); cursor:pointer;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); color:#fff; font-weight:700;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
  text-decoration:none;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn--ghost{ background:#fff; color:#111; border:1px solid var(--border); box-shadow:none; }
.btn--light{ background:#fff; color:#111; border:1px solid var(--border); }
.btn--sm{ --h: 36px; font-weight:600; }
.btn--xl{ --h: 50px; }
.btn--block{ width:100%; }
.badge{ background: var(--accent); color:#7c2d4d; border-radius:999px; padding:.1rem .42rem; font-size:.78rem; margin-inline-start:.25rem; }

/* ---------- Product Grid (simple) ---------- */
.products{ display:grid; gap:16px; grid-template-columns:repeat(4, 1fr); }
.product-card{ border:1px solid var(--border); border-radius:12px; overflow:hidden; background:#fff; }
.product-card__media{ display:block; aspect-ratio:4/5; background: var(--surface); }
.product-card__body{ padding:12px; display:grid; gap:6px; }
.product-card__title{ font-weight:700; color:#111827; }
.product-card__price{ display:flex; align-items:center; gap:8px; }
.product-card__price del{ color: var(--muted); }
.product-card__actions{ display:flex; gap:8px; }

/* ---------- Catalog / Filters ---------- */
.catalog{ display:grid; grid-template-columns: 260px 1fr; gap:16px; }
.filters{ align-self:start; position:sticky; top:72px; background:#fff; border:1px solid var(--border); border-radius:12px; padding:12px; }
.filter{ border-top:1px dashed var(--border); padding:12px 0; }
.filter:first-child{ border-top:none; }
.option-chips{ display:flex; flex-wrap:wrap; gap:.5rem; }
.option-chips .chip{ padding:.45rem .75rem; border:1px solid var(--border); border-radius:10px; background:#fff; }
.option-chips .chip.is-active{ border-color: var(--brand); background: #fff0f4; }

/* ---------- Cart / Checkout rows ---------- */
.cart{ display:grid; grid-template-columns: 1.15fr .85fr; gap:16px; }
.cart__item{ display:grid; grid-template-columns: 88px 1fr auto; gap:12px; align-items:center; border-bottom:1px solid var(--border); padding-block:12px; }
.cart__item img{ width:88px; height:88px; object-fit:cover; border-radius:10px; }

/* ---------- Footer ---------- */
.footer{ background: var(--surface); border-top:1px solid var(--border); margin-top:40px; }
.footer__bottom{ border-top:1px solid var(--border); padding:12px 0; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 992px){
  .grid--4, .products{ grid-template-columns: repeat(2,1fr); }
  .catalog{ grid-template-columns: 1fr; }
  .filters{ position: static; }
  .hero__inner{ grid-template-columns:1fr; }
}
@media (max-width: 640px){
  .grid--3, .grid--2, .products{ grid-template-columns: 1fr; }
  .nav__toggle{ display:inline-flex; width:40px; height:40px; border:1px solid var(--border); border-radius:10px; background:#fff; }
  .menu{ display:none; } /* منوی موبایل از Drawer بیاید */
}

/* ---------- Tiny helpers ---------- */
.breadcrumb{ display:flex; gap:8px; align-items:center; color:var(--muted); margin:16px auto; }
.list-unstyled{ list-style:none; padding:0; margin:0; display:grid; gap:6px; }
.products .empty{ padding:24px; text-align:center; color:var(--muted); }


.auth{ display:flex; justify-content:center; }
.auth-card{
  width:100%; max-width: 560px;
  background:#fff; border:1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin: 24px 0; box-shadow: var(--shadow-sm);
}
.auth-tabs{ display:flex; gap:8px; margin-bottom:8px; }
.auth-title{ margin: 4px 0 14px; font-size: 1.3rem; color:#0f172a; }

.auth-form .form__row{ display:grid; gap:6px; margin-bottom:12px; }
.auth-form input{
  height:42px; border:1px solid var(--border); border-radius:10px;
  padding:0 12px; background:#fff;
}
.error{ color:#b91c1c; }
.error-box{ background:#fee2e2; border:1px solid #fecaca; color:#7f1d1d; padding:8px 10px; border-radius:10px; }

.nav__actions form { display:inline; }
.nav__actions .btn { vertical-align: middle; }


.product-card__media {
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;           /* لبه‌های بیرون‌زده را ببُر */
  border-bottom: 1px solid var(--border);
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* مهم‌ترین خط: برش تمیز داخل قاب */
  display: block;
}

/* کمی به کارت‌ها نظم و هوور آرام بدهیم (دلخواه) */
.product-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .18s ease, transform .12s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ========== Product detail gallery ========== */
.product__gallery { display: grid; gap: 10px; }
.gallery__preview {
  aspect-ratio: 4 / 5;        /* پیش‌نمایش هم با نسبت یکنواخت */
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.gallery__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* پرکردن قاب اصلی */
  display: block;
}
.gallery__thumbs {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery__thumbs img {
  width: 70px;
  height: 70px;
  object-fit: cover;          /* بندانگشتی‌ها مربعی و تمیز */
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.gallery__thumbs img:is(:hover,.is-active) {
  border-color: var(--brand);
}

/* ========== Admin/Anywhere small cart images (در صورت نمایش) ========== */
.cart__item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
}

/* ========== ریسپانسیو کوچک ========== */
@media (max-width: 992px){
  .gallery__thumbs { grid-auto-flow: column; }
}


.catalog {
  display: grid;
  grid-template-columns: 280px 1fr; /* سایدبار ثابت و تمیز */
  gap: 16px;
}

.filters {
  align-self: start;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
}

.filters * { box-sizing: border-box; }

.filters input,
.filters select,
.filters button {
  width: 100%;         /* مهم: کشاندن فیلدها به عرض باکس */
  min-width: 0;        /* جلوگیری از بیرون‌زدگی در مرورگرها */
}

.filters .grid--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filters .filter { padding: 10px 0; border-top: 1px dashed var(--border, #e5e7eb); }
.filters .filter:first-child { border-top: 0; }

@media (max-width: 992px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters .grid--2 { grid-template-columns: 1fr; } /* موبایل: ورودی‌ها زیر هم */
}


.product-detail{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:24px;
  align-items:start;
}
@media (max-width: 992px){ .product-detail{ grid-template-columns:1fr; } }

.pd-gallery{ display:grid; gap:12px; }
.pd-main{
  border:1px solid var(--border,#e5e7eb);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.pd-main img{
  width:100%;
  height:auto;
  display:block;
  aspect-ratio: 4 / 5;       /* نسبت استاندارد پوشاک */
  object-fit: cover;         /* جلوگیری از کشیدگی */
}

.pd-thumbs{ display:flex; gap:8px; flex-wrap:wrap; }
.pd-thumb{
  border:1px solid var(--border,#e5e7eb);
  border-radius:10px;
  overflow:hidden;
  padding:0; background:#fff; cursor:pointer;
}
.pd-thumb img{ width:68px; height:68px; object-fit:cover; display:block; }
.pd-thumb.is-active{ outline:2px solid var(--brand,#ea3b74); }

.pd-info{ display:grid; gap:12px; position:relative; }
.pd-title{ margin:0; font-size:clamp(20px,3.2vw,28px); }
.pd-short{ margin-top:4px; }

.pd-price{ display:flex; align-items:center; gap:10px; font-size:1.1rem; }
.pd-price del{ color:#9aa1ac; }

.pd-form{ display:grid; gap:12px; max-width:420px; }
.pd-field{ display:grid; gap:6px; }
.pd-field select, .pd-field input{
  width:100%;
  border:1px solid var(--border,#e5e7eb);
  border-radius:10px;
  padding:.6rem .75rem;
  background:#fff;
}
.pd-qty input{ width:120px; }

.pd-cta{ display:flex; gap:10px; flex-wrap:wrap; }
.pd-tabs{ display:flex; gap:12px; margin-top:4px; }
.pd-tab{ background:transparent; border:none; padding:.5rem .75rem; border-bottom:2px solid transparent; cursor:pointer; }
.pd-tab.is-active{ border-bottom-color: var(--brand,#ea3b74); }
.pd-tabpanel{ margin-top:6px; }

@media (max-width: 992px){
  .pd-gallery{ margin-bottom: 8px; }
}

/* دکمه‌های تب جزئیات (اختیاری) */
.pd-tab { color:#475569; }
.pd-tab.is-active { color:#0f172a; }
