/* ==========================================================================
   تئوری طراحی: «برگه‌ی بارنامه‌ی انبار»
   این فروشگاه فایل‌های کاری (اکسل انبارداری/مدیریتی و برنامه) می‌فروشه،
   پس هویت بصری از دنیای بارنامه، مهر تحویل و کارت انبار گرفته شده:
   کاغذ گرم، مهر برنزی/زنگاری، خط‌چین پرفراژ، و کدهای رهگیری. 
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --paper: #f3ede0;
    --paper-deep: #e9e0cc;
    --ink: #1d2333;
    --ink-soft: #4b4636;
    --navy: #16213a;
    --navy-deep: #0f1728;
    --brass: #b8863b;
    --brass-deep: #93692a;
    --rust: #a33b2b;
    --line: #cdbfa0;
    --paid: #4c6b4f;

    --font-display: 'Vazirmatn', sans-serif;
    --font-body: 'Vazirmatn', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    direction: rtl;
    font-size: 16px;
    line-height: 1.7;
}

body {
    background-image:
        linear-gradient(var(--paper) 0%, var(--paper) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(180,160,110,0.07) 28px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0 0 .5em;
    color: var(--navy-deep);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------- Header ---------------- */
.site-header {
    position: relative;
    background: var(--navy);
    color: var(--paper);
    border-bottom: 3px solid var(--brass);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
}
.brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    width: 56px; height: 56px;
    display: block;
}
.nav-links { display: flex; gap: 20px; align-items: center; font-size: 14.5px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { opacity: .9; transition: opacity .15s; display: inline-flex; align-items: center; gap: 6px; }
.nav-links a:hover { opacity: 1; color: var(--brass); }
.nav-links .btn { margin-inline-start: 4px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-brass {
    background: var(--brass);
    color: var(--navy-deep);
}
.btn-brass:hover { background: var(--brass-deep); }
.btn-outline {
    background: transparent;
    border-color: var(--paper);
    color: var(--paper);
}
.btn-outline:hover { border-color: var(--brass); color: var(--brass); }
.btn-dark {
    background: var(--navy-deep);
    color: var(--paper);
}
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.hero {
    padding: 72px 0 56px;
    border-bottom: 1px dashed var(--line);
    position: relative;
}
.hero-eyebrow {
    font-family: var(--font-mono);
    letter-spacing: 2px;
    font-size: 13px;
    color: var(--rust);
    text-transform: uppercase;
    margin-bottom: 14px;
    display: inline-block;
    border: 1px solid var(--rust);
    padding: 3px 10px;
    border-radius: 2px;
    transform: rotate(-2deg);
}
.hero h1 {
    font-size: clamp(30px, 4vw, 46px);
    max-width: 720px;
    line-height: 1.35;
}
.hero p.lead {
    max-width: 560px;
    color: var(--ink-soft);
    font-size: 17px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 20px;
}
.hero-art { display: flex; justify-content: center; }
.hero-art svg, .hero-art img { width: 100%; max-width: 260px; }
@media (max-width: 800px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { order: -1; max-width: 180px; margin: 0 auto; }
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px dashed var(--line);
}
.stat-block { text-align: center; }
.stat-num {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--brass-deep);
}
.stat-lbl { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.why-us { padding-top: 0; }
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
@media (max-width: 700px) { .why-grid { grid-template-columns: 1fr; } }
.why-item {
    text-align: center;
    padding: 26px 20px;
    background: #fbf8f1;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.why-img {
    width: 84px; height: 84px;
    margin: 0 auto 16px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.why-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.why-img.why-img-empty {
    border: 1.5px dashed var(--brass);
    background: #fbf8f1;
}
.why-item h3 { font-size: 16px; margin-bottom: 6px; }
.why-item p { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.8; }

/* ---------------- Section headings ---------------- */
.section { padding: 56px 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    border-bottom: 2px solid var(--navy-deep);
    padding-bottom: 10px;
    margin-bottom: 28px;
}
.section-head h2 { margin: 0; font-size: 24px; }
.section-head .tag {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* ---------------- Product grid & "manifest slip" card ---------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
}
.slip {
    background: #fbf8f1;
    border: 1px solid var(--line);
    border-radius: 14px;
    position: relative;
    box-shadow: 0 2px 10px rgba(29,35,51,0.06);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.slip:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(29,35,51,0.13); }
.slip:hover .slip-image { transform: scale(1.04); }
.slip-image { transition: transform 0.3s ease; }
.slip-top { padding: 20px 20px 14px; position: relative; }
.slip-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--brass-deep);
    text-transform: uppercase;
    border: 1px solid var(--brass);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.slip h3 { font-size: 18px; margin-bottom: 6px; }
.slip .desc { font-size: 14px; color: var(--ink-soft); min-height: 42px; }

.slip .perforation {
    border-top: 2px dashed var(--line);
    position: relative;
    margin-top: auto;
}
.slip .perforation::before,
.slip .perforation::after {
    content: "";
    position: absolute;
    top: -8px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--line);
}
.slip .perforation::before { right: -9px; }
.slip .perforation::after { left: -9px; }

.slip-bottom {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.price-tag {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--navy-deep);
}
.stamp {
    position: absolute;
    top: 14px; left: 14px;
    width: 58px; height: 58px;
    border: 2px solid var(--rust);
    border-radius: 50%;
    color: var(--rust);
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    transform: rotate(-14deg);
    opacity: .85;
    pointer-events: none;
}

/* ---------------- Product detail ---------------- */
.product-detail {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }

.buy-box {
    background: var(--navy);
    color: var(--paper);
    border-radius: 14px;
    padding: 26px;
    border: 1px solid var(--navy-deep);
}
.buy-box .price-tag { color: var(--brass); font-size: 26px; }
.buy-box .meta-row {
    display: flex; justify-content: space-between;
    font-size: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12);
}
.buy-box .btn { margin-top: 18px; }
.buy-box-trust {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255,255,255,.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: rgba(243,237,224,.8);
}

/* ---------------- Forms ---------------- */
.form-box {
    max-width: 440px;
    margin: 40px auto;
    background: #fbf8f1;
    border: 1px solid var(--line);
    padding: 32px;
    border-radius: 14px;
}
.form-box h2 { text-align: center; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-family: var(--font-body);
    font-size: 15px;
    background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--brass);
    outline-offset: 1px;
}
.help-link { text-align: center; margin-top: 14px; font-size: 14px; color: var(--ink-soft); }
.help-link a { color: var(--brass-deep); font-weight: 700; }

/* ---------------- Password show/hide toggle ---------------- */
.password-wrap { position: relative; }
.password-wrap input {
    padding-inline-end: 42px; /* جا برای آیکون چشم، بدون همپوشانی با متن */
}
.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
}
.password-toggle:hover { color: var(--brass-deep); }
.password-toggle .icon { width: 19px; height: 19px; }

.alert {
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 9px;
}
.alert::before {
    content: "";
    width: 18px; height: 18px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
}
.alert-error { background: #fbeae6; border-color: var(--rust); color: var(--rust); }
.alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a33b2b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19L12 4z'/%3E%3Cpath d='M12 10.5v4.2M12 17.3h.01'/%3E%3C/svg%3E");
}
.alert-success { background: #ecf3ec; border-color: var(--paid); color: var(--paid); }
.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c6b4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M8.5 12.3l2.3 2.3 4.7-5.1'/%3E%3C/svg%3E");
}

/* ---------------- Ledger table (orders / dashboard) ---------------- */
.ledger {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fbf8f1;
    border: 1px solid var(--line);
}
.ledger th, .ledger td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}
.ledger th {
    background: var(--navy);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.ledger tr:last-child td { border-bottom: none; }
.order-code { font-family: var(--font-mono); font-weight: 700; }

.badge { font-family: var(--font-mono); font-size: 12px; padding: 3px 9px; border-radius: 20px; }
.badge-paid { background: #ecf3ec; color: var(--paid); border: 1px solid var(--paid); }
.badge-pending { background: #fbf3e3; color: var(--brass-deep); border: 1px solid var(--brass); }
.badge-failed { background: #fbeae6; color: var(--rust); border: 1px solid var(--rust); }

/* ---------------- Cart icon ---------------- */
.cart-link { position: relative; }
.cart-count {
    background: var(--rust);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 4px;
    padding: 0 4px;
}

/* ---------------- Trust strip ---------------- */
.trust-strip {
    background: var(--paper-deep);
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
    padding: 14px 0;
    margin-top: 50px;
}
.trust-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    font-size: 14px;
    color: var(--ink-soft);
}

/* ---------------- Icons (self-hosted SVG sprite, no emoji) ---------------- */
.icon {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    vertical-align: -0.18em;
}
.star-row { display: inline-flex; gap: 1px; align-items: center; }
.star-on { color: var(--brass); }
.star-off { color: var(--line); }
.label-icon { width: 0.95em; height: 0.95em; vertical-align: -0.12em; }

/* ---------------- Breadcrumb ---------------- */
.breadcrumb {
    font-size: 13px;
    color: var(--ink-soft);
}
.breadcrumb a { color: var(--brass-deep); }
.breadcrumb span { color: var(--ink); }

/* ---------------- Search + filters ---------------- */
.search-bar {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin-bottom: 18px;
}
.search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 14px;
}
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.chip {
    font-size: 13px;
    padding: 5px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink-soft);
}
.chip.active, .chip:hover {
    background: var(--navy);
    color: var(--paper);
    border-color: var(--navy);
}

/* ---------------- Gallery ---------------- */
.gallery-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}
.gallery-thumb {
    height: 90px;
    border-radius: 8px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

/* ---------------- Contents list ---------------- */
.contents-box {
    background: #fbf8f1;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 22px;
    margin: 20px 0;
}
.contents-box h3 { font-size: 16px; margin-bottom: 10px; }
.contents-box ul { margin: 0; padding-inline-start: 20px; font-size: 14px; color: var(--ink-soft); line-height: 2; }

/* ---------------- Reviews ---------------- */
.reviews-block { margin-top: 34px; border-top: 2px solid var(--navy-deep); padding-top: 20px; }
.review-item { border-bottom: 1px dashed var(--line); padding: 14px 0; font-size: 14px; }
.review-item p { margin: 6px 0 0; color: var(--ink-soft); }
.review-form { margin-top: 20px; max-width: 420px; }

/* ---------------- About page banner ---------------- */
.about-banner {
    width: 100%;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.about-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-banner.about-banner-empty { border: 1.5px dashed var(--brass); background: #fbf8f1; height: 0; margin-bottom: 0; }

/* ---------------- Legal pages (terms/privacy) ---------------- */
.legal-page { max-width: 760px; }
.legal-page h2 { font-size: 18px; margin-top: 32px; color: var(--navy-deep); border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.legal-page p, .legal-page li { color: var(--ink-soft); font-size: 15px; line-height: 2; }
.legal-page ul { padding-inline-start: 22px; }
.legal-updated { font-size: 13px; font-family: var(--font-mono); color: var(--brass-deep); margin-bottom: 24px; }

/* ---------------- FAQ ---------------- */
.faq-item { border-bottom: 1px dashed var(--line); padding: 16px 0; }
.faq-item h3 { font-size: 16px; color: var(--navy-deep); margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.site-footer {
    background: var(--navy-deep);
    color: rgba(243,237,224,0.7);
    padding: 24px 0;
    font-size: 14px;
    text-align: center;
    border-top: 3px solid var(--brass);
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}
.footer-links a { opacity: .85; }
.footer-links a:hover { opacity: 1; color: var(--brass); }

/* ---------------- Product image / placeholder ---------------- */
.slip-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
}
.slip-image-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.slip-image-placeholder svg { width: 46px; height: 46px; opacity: .55; }

.product-image-lg {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    margin-bottom: 20px;
}
.product-image-placeholder-lg {
    width: 100%;
    height: 260px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-radius: 12px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.product-image-placeholder-lg svg { width: 70px; height: 70px; opacity: .55; }

/* ---------------- Admin ---------------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 76px); }
.admin-side { background: var(--navy-deep); color: var(--paper); padding: 24px 0; }
.admin-side a { display: flex; align-items: center; gap: 9px; padding: 12px 24px; font-size: 14px; opacity: .85; }
.admin-side a:hover, .admin-side a.active { opacity: 1; background: rgba(255,255,255,.06); color: var(--brass); }
.admin-main { padding: 32px; }
@media (max-width: 700px) { .admin-shell { grid-template-columns: 1fr; } }

.stat-cards { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 30px; }
.stat-card {
    background: #fbf8f1; border: 1px solid var(--line);
    padding: 18px 22px; border-radius: 12px; min-width: 160px;
}
.stat-card .num { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--navy-deep); }
.stat-card .lbl { font-size: 13px; color: var(--ink-soft); }

.mobile-toggle { display: none; }
@media (max-width: 640px) {
    .mobile-toggle {
        display: flex;
        background: none;
        border: 1px solid var(--paper);
        color: var(--paper);
        border-radius: 9px;
        padding: 8px 10px;
        cursor: pointer;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0; left: 0;
        background: var(--navy);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        border-bottom: 3px solid var(--brass);
        z-index: 50;
    }
    .nav-links.open { display: flex; }
    .nav-links a, .nav-links .btn {
        padding: 14px 24px;
        border-radius: 0;
        margin: 0;
        width: 100%;
        justify-content: center;
    }
}

/* ---------------- Broad mobile responsiveness pass ---------------- */
@media (max-width: 600px) {
    body { font-size: 15px; }
    .container { padding: 0 18px; }
    .section { padding: 34px 0; }
    .hero { padding: 30px 0 26px; }
    .hero h1 { font-size: 23px; line-height: 1.45; }
    .hero p.lead { font-size: 14.5px; }
    .hero-eyebrow { padding: 4px 10px; font-size: 11.5px; }
    .hero-actions { flex-wrap: wrap; gap: 10px; }
    .hero-actions .btn { flex: 1; text-align: center; min-height: 46px; }
    .stats-bar { gap: 28px; margin-top: 28px; padding-top: 22px; }
    .stat-num { font-size: 22px; }

    .site-header .container { height: 68px; }
    .brand-logo { width: 40px; height: 40px; }
    .brand { font-size: 16px; gap: 8px; }
    .mobile-toggle { padding: 9px 11px; }

    h1 { font-size: 22px; }
    h2 { font-size: 19px; }
    .section-head h2 { font-size: 18px; }

    /* every tappable control gets a comfortable minimum touch target */
    .btn { min-height: 44px; padding: 10px 18px; font-size: 14.5px; }
    .field input, .field textarea, .field select { min-height: 46px; font-size: 16px; }
    .chip { padding: 7px 14px; }

    /* tables become horizontally scrollable instead of overflowing/breaking layout */
    .ledger { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; border-radius: 10px; }
    .ledger th, .ledger td { padding: 11px 14px; font-size: 13.5px; }

    .product-detail { grid-template-columns: 1fr; gap: 26px; }
    .buy-box { padding: 20px; border-radius: 14px; }
    .form-box { padding: 24px 20px; margin: 20px auto; border-radius: 14px; }
    .admin-main { padding: 16px; }
    .admin-side { padding: 14px 0; }
    .stat-cards { gap: 10px; }
    .stat-card { min-width: calc(50% - 5px); padding: 14px 16px; }
    .search-bar { max-width: 100%; }
    .search-bar input { min-height: 46px; }

    .product-grid { gap: 18px; }
    .slip-top { padding: 16px 16px 12px; }
    .slip-bottom { padding: 14px 16px 16px; }
    .slip h3 { font-size: 16.5px; }
    .why-grid { gap: 16px; }
    .why-item { padding: 22px 18px; }
    .why-img { width: 72px; height: 72px; border-radius: 14px; }

    .trust-strip { padding: 16px 0; margin-top: 34px; }
    .trust-inner { flex-direction: column; align-items: center; gap: 10px; font-size: 13px; text-align: center; }
    .buy-box-trust { font-size: 12.5px; gap: 10px; }
    .gallery-thumb { height: 66px; }
    .gallery-row { gap: 8px; }

    .legal-page h2 { font-size: 16px; }
    .legal-page p, .legal-page li { font-size: 14px; line-height: 1.9; }

    .about-banner { height: 150px; border-radius: 12px; }
    .site-footer { padding: 26px 0; }
    .footer-links { gap: 14px; flex-wrap: wrap; row-gap: 8px; }

    /* comfortable scroll clearance at the very bottom on mobile browsers with UI chrome */
    body { padding-bottom: env(safe-area-inset-bottom, 0); }
}

@media (max-width: 380px) {
    .stat-card { min-width: 100%; }
    .hero-eyebrow { font-size: 11px; }
    .container { padding: 0 14px; }
    .why-grid { grid-template-columns: 1fr; }
}
/* Mobile layouts: content wraps rather than forcing a wider page. */
.admin-main, .admin-side, .product-detail > *, .hero-grid > * { min-width: 0; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.mobile-cell-label, .admin-menu-toggle { display: none; }
input, select, textarea { max-width: 100%; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

@media (max-width: 700px) {
    .admin-shell { display: block; }
    .admin-side { padding: 0; }
    .mobile-ready .admin-menu-toggle {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; padding: 14px 18px; min-height: 48px;
        border: 0; color: var(--paper); background: var(--navy-deep);
        font: inherit; cursor: pointer; text-align: start;
    }
    .mobile-ready #adminNavigation { display: none; }
    .mobile-ready #adminNavigation.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-side a { padding: 12px; min-height: 44px; }
}
@media (max-width: 640px) {
    .nav-links { max-height: calc(100dvh - 72px); overflow-y: auto; }
    .mobile-toggle {
        width: 44px; height: 44px; min-width: 44px; min-height: 44px;
        padding: 0; flex-shrink: 0; align-items: center; justify-content: center;
        line-height: 1;
    }
    .mobile-toggle .icon { display: block; width: 24px; height: 24px; margin: 0; flex-shrink: 0; }
    body:not(.mobile-ready) .mobile-toggle { display: none; }
    body:not(.mobile-ready) .site-header .container { height: auto; flex-wrap: wrap; padding-block: 12px; }
    body:not(.mobile-ready) .nav-links { display: flex; position: static; width: 100%; max-height: none; }
}
@media (max-width: 600px) {
    .container, .form-box, .admin-main { overflow-wrap: anywhere; }
    .form-box { width: calc(100% - 28px); }
    .stats-bar, .section-head, .search-bar, .buy-box-trust { flex-wrap: wrap; }
    .hero-actions .btn { flex-basis: 140px; }
    .search-bar input { min-width: 0; }
    .brand { min-width: 0; }
    .brand-logo { flex-shrink: 0; }
    .stat-card { flex: 1 1 140px; min-width: 0; }
    .admin-main form { max-width: 100%; }
    .password-toggle { min-width: 44px; min-height: 44px; }
    .ledger.mobile-cards { display: block; white-space: normal; overflow: visible; border: 0; background: transparent; }
    .ledger.mobile-cards thead {
        position: absolute; width: 1px; height: 1px; padding: 0;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .ledger.mobile-cards tbody { display: block; }
    .ledger.mobile-cards tr { display: block; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbf8f1; padding: 6px 14px; }
    .ledger.mobile-cards td { display: block; width: 100%; max-width: none !important; padding: 10px 0; text-align: start; white-space: normal; overflow-wrap: anywhere; }
    .ledger.mobile-cards td:last-child { border-bottom: 0; }
    .ledger.mobile-cards .mobile-cell-label { display: block; color: var(--ink-soft); font-family: var(--font-body); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
    .ledger.mobile-cards .mobile-cell-label:empty { display: none; }
    .ledger.mobile-cards td a, .ledger.mobile-cards td button { min-height: 44px; display: inline-flex; align-items: center; }
    .ledger.mobile-cards td form { display: inline-block !important; margin-block: 3px; }
    .ledger.mobile-cards td.ledger-empty { text-align: center; }
}

/*.footer-enamad {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.footer-enamad img { background: #fff; border-radius: 6px; padding: 2px; }

/* Purchase journey */
.container.section { padding-inline: 24px; }
.purchase-steps { margin: 0 0 30px; }
.purchase-steps ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.purchase-steps li { display: flex; align-items: center; gap: 9px; padding: 12px 8px; border-bottom: 2px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.purchase-steps .step-number { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; font-family: var(--font-mono); }
.purchase-steps .is-current { color: var(--navy); font-weight: 800; border-color: var(--brass); }
.purchase-steps .is-current .step-number { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.purchase-steps .is-complete { color: var(--paid); border-color: var(--paid); }
.journey-eyebrow { font-size: 12px; letter-spacing: 0; color: var(--brass-deep); font-weight: 700; margin: 0 0 8px; }
.journey-muted { color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
.journey-note { font-size: 13px; line-height: 1.9; color: var(--ink-soft); padding-top: 14px; border-top: 1px dashed var(--line); }
.journey-panel { padding: 24px; border: 1px solid var(--line); background: #fbf8f1; border-radius: 14px; min-width: 0; }
.journey-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--brass-deep); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.journey-help { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.journey-help a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.journey-empty { text-align: center; padding: 48px 24px; }
.journey-empty > .icon { display: block; width: 44px; height: 44px; margin: 0 auto 18px; color: var(--brass-deep); }
.journey-empty .journey-link { display: flex; justify-content: center; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr); gap: 28px; align-items: start; }
.checkout-layout > * { min-width: 0; }
.order-summary { position: sticky; top: 20px; border-top: 4px solid var(--brass); }
.order-summary h2 { font-size: 21px; margin-bottom: 22px; }
.summary-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 0; font-size: 14px; }
.summary-total { border-top: 1px solid var(--line); margin-top: 16px; font-size: 17px; }
.coupon-details { border-top: 1px dashed var(--line); padding-top: 12px; }
.coupon-details summary { cursor: pointer; padding: 8px 0; font-size: 14px; }
.coupon-form { display: flex; align-items: end; gap: 8px; padding-top: 12px; }
.coupon-form .field { flex: 1; min-width: 0; margin: 0; font-size: 13px; }
.coupon-form input { width: 100%; margin-top: 6px; }
.coupon-applied { color: var(--paid); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.cart-file-list { display: grid; gap: 16px; }
.cart-file { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 18px; }
.cart-cover, .cart-file-icon { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; }
.cart-file-icon { display: grid; place-items: center; background: var(--paper-deep); color: var(--navy); }
.cart-file-icon .icon { width: 30px; height: 30px; }
.cart-file-info { min-width: 0; }
.cart-file h2 { font-size: 17px; line-height: 1.8; }
.cart-file-info p { margin: 6px 0; }
.cart-file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); padding-top: 14px; }
.buy-heading { font-size: 21px; color: var(--paper); }
.buy-box .journey-muted { color: var(--paper); opacity: .8; }
.buy-box .journey-eyebrow { color: var(--brass); }
#purchase { scroll-margin-top: 20px; }
.mobile-purchase-bar { display: none; }
.download-library { margin: 24px 0 40px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px; }
.library-file { display: flex; flex-direction: column; align-items: start; gap: 12px; }
.library-file h3 { flex: 1; font-size: 18px; }
.order-file-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
@media (max-width: 800px) {
    .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .order-summary { position: static; }
    .mobile-purchase-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--navy); color: var(--paper); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; align-items: center; gap: 12px; box-shadow: 0 -3px 16px #0002; font-size: 14px; }
    body:has(.mobile-purchase-bar) { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
    .container.section { padding-inline: 16px; }
    .purchase-steps li { flex-direction: column; text-align: center; font-size: 11px; padding: 8px 0; gap: 6px; }
    .purchase-steps ol { gap: 6px; }
    .journey-panel { padding: 18px; }
    .cart-file { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
    .cart-cover, .cart-file-icon { width: 48px; height: 48px; }
    .summary-total { font-size: 16px; }
}

/* Verified product facts, supplied by the store owner. */
.product-spec-editor { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.product-spec-editor legend { padding: 0 8px; font-weight: 700; }
.product-spec-editor small { display: block; font-size: 12px; margin-top: 6px; }
.product-specs { display: grid; gap: 16px; margin: 24px 0; }
.product-specs:empty { display: none; }
.product-spec h2, .product-previews h2 { font-size: 19px; }
.product-spec ul { margin: 10px 0 0; padding-inline-start: 22px; line-height: 1.9; color: var(--ink-soft); overflow-wrap: anywhere; }
.product-spec li + li { margin-top: 8px; }
.product-previews { margin: 20px 0; }
.product-previews .gallery-row { padding: 4px 4px 12px; }
@media (max-width: 600px) {
    .product-spec-editor { padding: 14px; }
    .product-spec h2, .product-previews h2 { font-size: 17px; }
}