/* =====================================================================
   ایتکو — استایل بخش فروشگاه
   ===================================================================== */

/* ---------------------------------------------------------------------
   هدر
   --------------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }

.topbar { background: var(--brand); color: #fff; font-size: 12.5px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 36px; gap: 12px; }
.topbar__note { opacity: .92; }
.topbar__links { display: flex; gap: 16px; }
.topbar__links a { color: #fff; opacity: .92; }
.topbar__links a:hover { opacity: 1; }

.header-main {
    display: flex; align-items: center; gap: 12px;
    padding-top: 12px; padding-bottom: 12px;
}

.menu-toggle { display: inline-flex; }

.search { flex: 1; display: flex; position: relative; max-width: 520px; }
.search input {
    width: 100%; font-family: inherit; font-size: 14px;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.search button {
    position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer;
    display: flex; align-items: center; padding: 4px;
}
.search button:hover { color: var(--brand); }

.header-actions { display: flex; gap: 2px; margin-inline-start: auto; }

/* ---------------------------------------------------------------------
   مگا منو
   --------------------------------------------------------------------- */
.mega-nav { border-top: 1px solid var(--line-soft); background: var(--surface); }
.mega-nav__list { display: flex; gap: 2px; }

.mega-nav__item { position: relative; }
.mega-nav__item > a {
    display: block; padding: 12px 14px;
    font-size: 14px; font-weight: 600; color: var(--ink);
    border-bottom: 2px solid transparent;
}
.mega-nav__item > a:hover { color: var(--brand); text-decoration: none; border-bottom-color: var(--brand); }

.mega-panel {
    position: absolute; top: 100%; inset-inline-start: 0; z-index: 40;
    min-width: 230px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow); padding: 10px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.mega-nav__item:hover .mega-panel,
.mega-nav__item:focus-within .mega-panel {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.mega-panel a {
    display: block; padding: 8px 12px; border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--ink);
}
.mega-panel a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ---------------------------------------------------------------------
   بخش قهرمان (Hero)
   --------------------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--brand) 0%, #0A5540 100%);
    color: #fff; padding: 52px 0;
}
.hero__text { max-width: 640px; }
.hero h1 { font-size: clamp(24px, 5vw, 38px); margin-bottom: 12px; color: #fff; }
.hero p  { font-size: clamp(14.5px, 2.2vw, 17px); opacity: .92; margin-bottom: 24px; }
.hero .btn--primary { background: #fff; color: var(--brand); }
.hero .btn--primary:hover { background: var(--brand-soft); }

/* ---------------------------------------------------------------------
   بخش‌ها
   --------------------------------------------------------------------- */
.section { padding: 40px 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }

.section__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 20px;
}
.section__head h2 { margin: 0; font-size: 19px; }

/* ---------------------------------------------------------------------
   دسته‌بندی‌ها
   --------------------------------------------------------------------- */
.category-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.category-card {
    display: flex; align-items: center; justify-content: center;
    min-height: 92px; padding: 16px 12px; text-align: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); color: var(--ink);
    font-weight: 600; font-size: 14px;
    transition: border-color .16s ease, color .16s ease;
}
.category-card:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------------------------------------------------------------------
   کارت محصول
   --------------------------------------------------------------------- */
.product-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.product-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; color: var(--ink);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.product-card:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }

.product-card__media { position: relative; aspect-ratio: 1; background: var(--line-soft); }
.product-card__media img { width: 100%; height: 100%; object-fit: contain; }
.product-card__placeholder {
    display: flex; align-items: center; justify-content: center; height: 100%;
    color: var(--muted); font-size: 12.5px;
}
.product-card__off, .product-card__used {
    position: absolute; top: 8px; padding: 2px 9px;
    border-radius: 20px; font-size: 11.5px; font-weight: 700;
}
.product-card__off  { inset-inline-start: 8px; background: var(--danger); color: #fff; }
.product-card__used { inset-inline-end: 8px; background: var(--accent-soft); color: var(--accent); }

.product-card__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card__name {
    margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__price { margin-top: auto; display: flex; flex-direction: column; gap: 1px; }
.product-card__old {
    font-size: 12px; color: var(--muted); text-decoration: line-through;
}
.product-card__now { font-size: 14.5px; font-weight: 700; color: var(--ink); }

/* ---------------------------------------------------------------------
   مزیت‌ها
   --------------------------------------------------------------------- */
.feature-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.feature h3 { font-size: 15px; margin-bottom: 4px; }
.feature p  { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ---------------------------------------------------------------------
   صفحات ثابت
   --------------------------------------------------------------------- */
.static-page {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px 24px; max-width: 800px; margin: 0 auto;
}
.static-page h1 { font-size: 22px; margin-bottom: 18px; }
.static-page__content { line-height: 2.1; }
.static-page__content h2 { font-size: 17px; margin-top: 24px; }
.static-page__content ul { list-style: disc; padding-inline-start: 22px; margin-bottom: 1em; }

/* ---------------------------------------------------------------------
   فوتر
   --------------------------------------------------------------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer__grid {
    display: grid; gap: 28px; padding-top: 36px; padding-bottom: 28px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.site-footer h3 { font-size: 14px; margin-bottom: 12px; }
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--muted); font-size: 13.5px; }
.site-footer a:hover { color: var(--brand); }
.site-footer__about { color: var(--muted); font-size: 13.5px; margin-top: 12px; }

.trust-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 96px; height: 96px; border: 1px dashed var(--line);
    border-radius: var(--radius); color: var(--muted);
    font-size: 11px; text-align: center; padding: 8px; line-height: 1.6;
}

.site-footer__bottom {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    border-top: 1px solid var(--line-soft);
    padding-top: 16px; padding-bottom: 16px;
    font-size: 12.5px; color: var(--muted);
}

/* ---------------------------------------------------------------------
   موبایل
   --------------------------------------------------------------------- */
@media (max-width: 860px) {
    .topbar__note { display: none; }
    .topbar__inner { justify-content: flex-end; }

    /* منو به صورت کشویی نمایش داده می‌شود */
    .mega-nav { display: none; border-top: 1px solid var(--line); }
    .mega-nav.is-open { display: block; }
    .mega-nav__list { flex-direction: column; gap: 0; padding: 8px 0; }
    .mega-nav__item > a { padding: 11px 4px; border-bottom: 1px solid var(--line-soft); }
    .mega-nav__item > a:hover { border-bottom-color: var(--line-soft); }

    .mega-panel {
        position: static; opacity: 1; visibility: visible; transform: none;
        border: none; box-shadow: none; padding: 4px 0 8px 16px;
        min-width: 0; display: none;
    }
    .mega-nav__item.is-expanded .mega-panel { display: block; }
    .mega-panel a { font-size: 13px; padding: 7px 12px; }
}

@media (min-width: 861px) {
    .menu-toggle { display: none; }
    .header-main { padding-top: 16px; padding-bottom: 16px; gap: 24px; }
}

@media (max-width: 600px) {
    .header-main { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .hero { padding: 36px 0; }
    .section { padding: 28px 0; }
}

/* =====================================================================
   مرحله ۳ — دسته‌بندی، محصول، جستجو و سبد خرید
   ===================================================================== */

/* ---- مسیر راهنما ---- */
.breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
    padding: 16px 0; font-size: 13px; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

.page-title { font-size: 21px; margin: 16px 0; }

/* ---- چیدمان صفحه دسته‌بندی ---- */
.catalog { display: grid; grid-template-columns: 1fr; gap: 20px; padding-bottom: 40px; }
@media (min-width: 900px) { .catalog { grid-template-columns: 248px 1fr; } }

.catalog__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.catalog__head h1 { margin: 0 0 2px; font-size: 20px; }
.catalog__count { font-size: 13px; color: var(--muted); }
.catalog__tools { display: flex; align-items: center; gap: 10px; }

.sort { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.sort select {
    font-family: inherit; font-size: 13.5px; padding: 7px 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
}

/* ---- نوار فیلتر ---- */
.filters {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; align-self: start;
}
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters__head h2 { margin: 0; font-size: 15px; }
.filters__close {
    display: none; background: none; border: none; font-size: 18px;
    color: var(--muted); cursor: pointer; padding: 4px 8px;
}

.filter-group { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.filter-group:first-of-type { border-top: none; padding-top: 0; }
.filter-group h3 { font-size: 13.5px; margin-bottom: 9px; }

.filter-links { display: flex; flex-direction: column; gap: 6px; }
.filter-links a { font-size: 13.5px; color: var(--ink); }
.filter-links a:hover { color: var(--brand); }

.filter-scroll { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }

.check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13.5px; cursor: pointer; padding: 3px 0;
}
.check input { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }

.swatch {
    display: inline-block; width: 15px; height: 15px; border-radius: 50%;
    border: 1px solid var(--line); flex-shrink: 0;
}

.price-inputs { display: flex; gap: 8px; }
.price-inputs input {
    width: 100%; font-family: inherit; font-size: 13px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); text-align: center;
}
.filter-hint { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); }

.filter-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }

/* ---- صفحه‌بندی ---- */
.pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    padding: 28px 0 8px;
}
.pagination__link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600;
}
.pagination__link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination__link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination__gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* ---- صفحه محصول ---- */
.product-detail {
    display: grid; grid-template-columns: 1fr; gap: 24px;
    padding-bottom: 32px;
}
@media (min-width: 860px) { .product-detail { grid-template-columns: 1fr 1fr; gap: 36px; } }

.gallery__main {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); aspect-ratio: 1; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }

.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery__thumb {
    flex: 0 0 66px; width: 66px; height: 66px; padding: 3px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); overflow: hidden;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb.is-active { border-color: var(--brand); }

.product-info h1 { font-size: 20px; line-height: 1.6; }
.product-info__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    font-size: 13px; color: var(--muted); margin-bottom: 14px;
}
.product-info__short { color: var(--muted); font-size: 14px; }

.badge--new  { background: var(--brand-soft); color: var(--brand); }
.badge--used { background: var(--accent-soft); color: var(--accent); }
.rating { color: var(--accent); font-weight: 700; }

.buy-box {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; margin-top: 18px;
    display: flex; flex-direction: column; gap: 16px;
}

.option-group { display: flex; flex-direction: column; gap: 8px; }
.option-group__label { font-size: 13.5px; font-weight: 700; }
.option-values { display: flex; flex-wrap: wrap; gap: 8px; }

.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__box {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.option__box:hover { border-color: var(--brand); }
.option input:checked + .option__box {
    border-color: var(--brand); background: var(--brand-soft); font-weight: 700;
}
.option input:focus-visible + .option__box { outline: 2px solid var(--brand); outline-offset: 2px; }

.price-box { display: flex; flex-direction: column; gap: 2px; }
.price-box__old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.price-box__now { font-size: 22px; font-weight: 800; }
.price-box__from { font-size: 15px; font-weight: 700; color: var(--muted); }
.price-box__hint { font-size: 12.5px; color: var(--accent); }

.stock-line { font-size: 13.5px; min-height: 20px; }
.in-stock  { color: var(--ok); font-weight: 600; }
.low-stock { color: var(--accent); font-weight: 700; }
.out-stock { color: var(--danger); font-weight: 600; }

.buy-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.qty { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.qty input {
    width: 78px; font-family: inherit; font-size: 14px; padding: 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); text-align: center;
}
.qty--sm input { width: 62px; padding: 6px; font-size: 13px; }
.buy-actions .btn { flex: 1; min-width: 170px; }
.buy-note { margin: 0; font-size: 12.5px; color: var(--muted); }

.panel-block {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.panel-block h2 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.rich-text { line-height: 2.1; }
.rich-text ul { list-style: disc; padding-inline-start: 22px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td {
    text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
}
.spec-table th { width: 34%; color: var(--muted); font-weight: 600; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

/* ---- نظرات ---- */
.review-list { display: flex; flex-direction: column; gap: 16px; }
.review { padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.review:last-child { border-bottom: none; padding-bottom: 0; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.review__stars { color: var(--accent); letter-spacing: 1px; }
.review__date { color: var(--muted); font-size: 12.5px; }
.review__title { font-size: 14px; margin: 8px 0 4px; }
.review__text { margin: 6px 0 0; font-size: 14px; }
.review__reply {
    margin-top: 10px; padding: 10px 14px; background: var(--brand-soft);
    border-radius: var(--radius-sm); font-size: 13.5px;
}

/* ---- سبد خرید ---- */
.cart { display: grid; grid-template-columns: 1fr; gap: 18px; padding-bottom: 40px; }
@media (min-width: 900px) { .cart { grid-template-columns: 1fr 306px; } }

.cart__items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    display: grid; grid-template-columns: 92px 1fr; gap: 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px;
}
@media (min-width: 640px) { .cart-item { grid-template-columns: 92px 1fr auto; } }
.cart-item.has-problem { border-color: #EBC9C4; background: #FEFAF9; }

.cart-item__media {
    width: 92px; height: 92px; background: var(--line-soft);
    border-radius: var(--radius-sm); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cart-item__media img { width: 100%; height: 100%; object-fit: contain; }

.cart-item__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cart-item__name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.cart-item__variant { font-size: 12.5px; color: var(--muted); }
.cart-item__problem { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.cart-item__controls { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }

.cart-item__price { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.cart-item__unit { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.cart-item__line { font-size: 12px; color: var(--muted); white-space: nowrap; }

.cart-summary {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; align-self: start;
    position: sticky; top: 16px;
}
.cart-summary h2 { font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.cart-summary__row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 7px 0; font-size: 14px;
}
.cart-summary__note {
    margin: 12px 0; padding: 11px 13px; background: var(--bg);
    border-radius: var(--radius-sm); font-size: 12.5px; color: var(--muted); line-height: 1.9;
}
.cart-summary__login { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.btn.is-disabled { pointer-events: none; opacity: .55; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- نشان تعداد سبد ---- */
.icon-btn--cart { position: relative; }
.cart-badge {
    position: absolute; top: 2px; inset-inline-start: 2px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--accent); color: #fff;
    border-radius: 20px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ---- پیشنهاد جستجو ---- */
.search { position: relative; }
.suggest {
    position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 60;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    max-height: 380px; overflow-y: auto; padding: 6px;
}
.suggest__item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink);
}
.suggest__item:hover { background: var(--brand-soft); text-decoration: none; }
.suggest__item img { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.suggest__name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__price { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---- پیام شناور ---- */
.toast {
    position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200;
    padding: 12px 20px; border-radius: var(--radius);
    background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px -10px rgba(22,33,28,.5);
    opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease;
    max-width: calc(100vw - 40px);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--error { background: var(--danger); }

/* ---- فیلتر در موبایل ---- */
@media (max-width: 899px) {
    .filters {
        /* در صفحه راست‌چین، inline-start همان لبه راست است؛ پس کشوی فیلتر
           از سمت راست وارد می‌شود و با translateX(100%) کاملاً از صفحه بیرون می‌رود. */
        position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 90;
        width: min(320px, 88vw); border-radius: 0; overflow-y: auto;
        transform: translateX(100%); transition: transform .2s ease;
    }
    .filters.is-open { transform: translateX(0); }
    .filters__close { display: block; }
}
@media (min-width: 900px) {
    .filters-toggle { display: none; }
}

/* =====================================================================
   مرحله ۴ — حساب کاربری، تسویه‌حساب و پرداخت
   ===================================================================== */

/* ---- کارت‌های ورود / ثبت‌نام / پرداخت تکمیلی ---- */
.auth-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px 26px;
    max-width: 460px; margin: 32px auto; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card__sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.auth-card__foot { text-align: center; margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }

.code-input {
    text-align: center; font-size: 26px; font-weight: 700;
    letter-spacing: 10px; font-family: var(--font-mono);
}

.link-button {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--brand); font-family: inherit; font-size: inherit; text-decoration: underline;
}

/* ---- تسویه‌حساب ---- */
.checkout { display: grid; grid-template-columns: 1fr; gap: 18px; padding-bottom: 40px; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1fr 320px; align-items: start; } }

.checkout__summary {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; position: sticky; top: 16px;
}
.checkout__summary h2 {
    font-size: 15px; margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}
.checkout__secure { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.checkout-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.checkout-items li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.checkout-items__name { flex: 1; line-height: 1.7; }
.checkout-items__name small { display: block; color: var(--muted); font-size: 11.5px; }
.checkout-items__qty { color: var(--muted); white-space: nowrap; }
.checkout-items__price { white-space: nowrap; font-weight: 600; }

.cart-summary__row--total {
    border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px;
    font-weight: 700; font-size: 15px;
}

.delivery-option {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 14px; margin-bottom: 10px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .15s ease, background-color .15s ease;
}
.delivery-option:hover { border-color: var(--brand); }
.delivery-option input { margin-top: 3px; accent-color: var(--brand); width: 17px; height: 17px; }
.delivery-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.delivery-option__body { display: flex; flex-direction: column; gap: 3px; }
.delivery-option__title { font-weight: 700; font-size: 14.5px; }
.delivery-option__desc { font-size: 12.5px; color: var(--muted); line-height: 1.9; }

/* ---- نتیجه پرداخت ---- */
.result-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 34px 26px; text-align: center;
    max-width: 520px; margin: 32px auto; box-shadow: var(--shadow);
}
.result-card__icon {
    width: 62px; height: 62px; margin: 0 auto 16px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 700;
}
.result-card--ok   .result-card__icon { background: var(--ok-soft);     color: var(--ok); }
.result-card--fail .result-card__icon { background: var(--danger-soft); color: var(--danger); }
.result-card h1 { font-size: 20px; margin-bottom: 6px; }
.result-card__msg { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.result-card__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.result-facts {
    display: flex; flex-direction: column; gap: 1px; margin: 0 0 6px;
    background: var(--line); border: 1px solid var(--line);
    border-radius: var(--radius-sm); overflow: hidden; text-align: right;
}
.result-facts > div {
    display: flex; justify-content: space-between; gap: 12px;
    background: var(--surface); padding: 10px 14px; font-size: 13.5px;
}
.result-facts dt { color: var(--muted); margin: 0; }
.result-facts dd { margin: 0; font-weight: 600; }
.amount-highlight { color: var(--brand); font-weight: 800; }

.notice--inline { margin: 16px 0 0; text-align: right; font-size: 13px; line-height: 2; }

/* ---- لیست سفارش‌ها ---- */
.account-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-top: 8px;
}

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 16px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); color: var(--ink); background: var(--surface);
    transition: border-color .15s ease;
}
.order-row:hover { border-color: var(--brand); text-decoration: none; }
.order-row__num { font-weight: 700; font-size: 13.5px; }
.order-row__date { color: var(--muted); font-size: 12.5px; }
.order-row__total { margin-inline-start: auto; font-weight: 700; white-space: nowrap; }

.order-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin: 8px 0 18px;
}
.order-head__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge--lg { font-size: 13px; padding: 5px 14px; }

.order-detail { display: grid; grid-template-columns: 1fr; gap: 16px; padding-bottom: 40px; }
@media (min-width: 900px) { .order-detail { grid-template-columns: 1fr 320px; align-items: start; } }

.order-items { display: flex; flex-direction: column; gap: 12px; }
.order-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.order-item__media {
    width: 64px; height: 64px; background: var(--line-soft);
    border-radius: var(--radius-sm); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.order-item__media img { width: 100%; height: 100%; object-fit: contain; }
.order-item__body { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; min-width: 0; }
.order-item__total { font-weight: 700; white-space: nowrap; font-size: 13.5px; }

/* ---- خط زمانی پیگیری ---- */
.timeline { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li {
    position: relative; display: flex; gap: 12px;
    padding: 0 0 18px 0; padding-inline-start: 22px;
}
.timeline li::before {
    content: ""; position: absolute; inset-inline-start: 5px; top: 14px; bottom: 0;
    width: 1px; background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline__dot {
    position: absolute; inset-inline-start: 0; top: 5px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--brand-soft); border: 2px solid var(--brand);
}
.timeline strong { font-size: 13.5px; display: block; }
.timeline__note { display: block; font-size: 12.5px; color: var(--muted); }
.timeline__date { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.mini-title { font-size: 13px; margin: 16px 0 8px; color: var(--muted); }
.payment-list { display: flex; flex-direction: column; gap: 8px; }
.payment-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.payment-list li:last-child { border-bottom: none; }

/* =====================================================================
   مرحله ۵ — حساب کاربری، علاقه‌مندی و نظرات
   ===================================================================== */

/* ---- دکمه علاقه‌مندی روی کارت محصول ---- */
.product-card-wrap { position: relative; display: flex; }
.product-card-wrap .product-card { flex: 1; }
.wish-form { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; }
.wish-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; cursor: pointer;
    background: rgba(255, 255, 255, .92); color: var(--muted);
    border: 1px solid var(--line); border-radius: 50%;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.wish-btn:hover { color: var(--danger); border-color: var(--danger); }
.wish-btn.is-on { color: var(--danger); border-color: var(--danger); background: #fff; }
.wish-btn.is-on svg path { fill: currentColor; }

/* کارت کارکرده نشانش را جابه‌جا می‌کند تا زیر قلب نیفتد */
.product-card-wrap .product-card__used { inset-inline-end: 46px; }

/* ---- چیدمان حساب کاربری ---- */
.account { display: grid; grid-template-columns: 1fr; gap: 18px; padding-bottom: 40px; }
@media (min-width: 860px) { .account { grid-template-columns: 210px 1fr; align-items: start; } }

.account-nav {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 10px;
}
.account-nav__link {
    display: block; padding: 10px 13px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--ink); text-align: right;
    background: none; border: none; width: 100%; cursor: pointer; font-family: inherit;
}
.account-nav__link:hover { background: var(--line-soft); text-decoration: none; }
.account-nav__link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.account-nav__logout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.account-nav__link--exit { color: var(--danger); }
.account-nav__link--exit:hover { background: var(--danger-soft); }

@media (max-width: 859px) {
    .account-nav { flex-direction: row; flex-wrap: wrap; }
    .account-nav__link { width: auto; }
    .account-nav__logout { margin: 0; padding: 0; border: none; }
}

.account__main { min-width: 0; }

.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.account-stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; text-align: center; color: var(--ink);
    transition: border-color .15s ease;
}
.account-stat:hover { border-color: var(--brand); text-decoration: none; }
.account-stat__value { display: block; font-size: 21px; font-weight: 800; color: var(--brand); }
.account-stat__label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.to-review { display: flex; flex-direction: column; gap: 8px; }
.to-review li { font-size: 13.5px; }

/* ---- دفترچه آدرس ---- */
.address-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.address-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; font-size: 13.5px;
}
.address-card.is-default { border-color: var(--brand); }
.address-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.address-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- علاقه‌مندی‌ها ---- */
.wishlist-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.wishlist-item { display: flex; flex-direction: column; gap: 8px; }
.wishlist-item__note { margin: 0; font-size: 12px; color: var(--danger); text-align: center; }

/* ---- نظرات ---- */
.review__pending { margin: 8px 0 0; font-size: 12.5px; color: var(--warn); }

.review-form { display: flex; flex-direction: column; gap: 14px; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label {
    font-size: 27px; line-height: 1; color: var(--line); cursor: pointer;
    transition: color .12s ease;
}
/* در RTL ستاره‌ها معکوس چیده شده‌اند، پس هم خودش و هم بعدی‌ها رنگی می‌شوند */
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--accent); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.review-login-note {
    background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm);
    padding: 14px 16px; font-size: 13.5px; color: var(--muted); margin: 0;
}

.buy-box-tail { display: flex; flex-direction: column; gap: 10px; }
.wish-inline { margin-top: -4px; }
.wish-inline__btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.wish-inline__btn.is-on { color: var(--danger); border-color: var(--danger); }
