:root {
    --bg: #F2F3F4;
    --bg-2: #E7E9EB;
    --surface: #FFFFFF;
    --surface-2: #F3F4F6;
    --line: #DCE0E3;
    --line-strong: #C7CDD2;
    --ink: #20262C;
    --ink-2: #565F68;
    --ink-3: #8B939A;
    --orange: #E2601C;
    --orange-dark: #B84A12;
    --orange-soft: #FBE3D3;
    --steel: #3D5064;
    --yellow: #F5B914;
    --green-ok: #2E7D4F;
    --green-soft: #E3F1E7;
    --red: #C23A3A;
    --red-soft: #FBE4E4;
    --thread: #B23A3A;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    background-image: linear-gradient(rgba(242,243,244,0.55), rgba(242,243,244,0.55)), url('/images/site-bg.png');
    background-size: cover;
    background-position: left bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--ink);
    font-family: 'IRANSans','Vazirmatn',sans-serif;
    min-height: 100vh;
}

@media (max-width:768px) {
    body {
        background-attachment: scroll;
    }
}

.mono {
    font-family: 'IBM Plex Mono',monospace;
}

a {
    color: inherit;
    text-decoration: none;
}

@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Regular.woff2') format('woff2'), url('/fonts/IRANSansWeb_Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Medium.woff2') format('woff2'), url('/fonts/IRANSansWeb_Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('/fonts/IRANSansWeb_Bold.woff2') format('woff2'), url('/fonts/IRANSansWeb_Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== Header ===== */
header.top {
    padding: 28px 24px 14px;
    text-align: center;
}

.logo-mark {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    display: block;
}

.brand {
    font-size: 23px;
    font-weight: 900;
    letter-spacing: .5px;
    color: var(--ink);
}

    .brand span {
        color: var(--orange);
    }

.tagline {
    font-size: 13px;
    color: var(--ink-2);
    margin-top: 6px;
    font-weight: 500;
}

.hazard-rule {
    width: 130px;
    height: 5px;
    margin: 14px auto 0;
    border-radius: 3px;
    background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--ink) 10px 20px);
    opacity: .85;
}

main {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 20px 90px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin: 6px 0 4px;
}

.section-sub {
    font-size: 13px;
    color: var(--ink-2);
    margin: 0 0 18px;
}

.back-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
}

    .back-btn:hover {
        border-color: var(--orange);
        color: var(--orange-dark);
    }

/* ===== Category grid ===== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
}

.cat-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
}

    .cat-card:hover {
        border-color: var(--orange);
        transform: translateY(-2px);
    }

    .cat-card img {
        width: 100%;
        aspect-ratio: 2/3;
        object-fit: contain;
        background: #15171b;
        border-radius: 10px;
        margin-bottom: 8px;
    }

    .cat-card .cat-name {
        font-size: 13px;
        font-weight: 700;
    }

@media (max-width:460px) {
    .cat-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

/* ===== Product grid ===== */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 14px;
}

.prod-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
}

    .prod-card:hover {
        border-color: var(--orange);
        transform: translateY(-2px);
    }

    .prod-card .photo {
        width: 100%;
        aspect-ratio: 2/3;
        object-fit: contain;
        background: #15171b;
        display: block;
    }

    .prod-card .info {
        padding: 10px 12px 14px;
    }

    .prod-card .p-name {
        font-size: 13.5px;
        font-weight: 700;
        margin-bottom: 3px;
    }

    .prod-card .p-price {
        font-family: 'IBM Plex Mono',monospace;
        font-size: 12.5px;
        color: var(--orange-dark);
        font-weight: 700;
    }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 9px;
    border: none;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    transition: transform .15s, background .2s;
    font-family: inherit;
}

    .btn:active {
        transform: scale(.97);
    }

.btn-primary {
    background: var(--orange);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--orange-dark);
    }

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border: 1.5px solid var(--line-strong);
}

    .btn-ghost:hover {
        border-color: var(--orange);
        color: var(--orange-dark);
    }

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 7px;
}

.btn-danger {
    background: var(--red-soft);
    color: var(--red);
}

    .btn-danger:hover {
        background: var(--red);
        color: #fff;
    }

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ===== Product modal ===== */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(20,24,28,.45);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 70;
}

    .modal-bg.visible {
        display: flex;
    }

.product-modal {
    background: var(--surface);
    width: 100%;
    max-width: 640px;
    border-radius: 18px 18px 0 0;
    padding: 22px 22px 26px;
    max-height: 88vh;
    overflow-y: auto;
}

.pm-photo {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 2/3;
    object-fit: contain;
    background: #15171b;
    border-radius: 12px;
    display: block;
    margin: 0 auto 14px;
    border: 1.5px solid var(--line-strong);
}

.pm-name {
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
}

.pm-price {
    font-family: 'IBM Plex Mono',monospace;
    font-size: 15px;
    color: var(--orange-dark);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.pm-desc {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.8;
    text-align: center;
    margin-bottom: 18px;
}

.size-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 8px;
}

.size-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.size-opt {
    padding: 9px 15px;
    border-radius: 8px;
    border: 1.5px solid var(--line-strong);
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'IBM Plex Mono',monospace;
    color: var(--ink-2);
}

    .size-opt.selected {
        background: var(--orange);
        border-color: var(--orange);
        color: #fff;
    }

.qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--orange);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.qty-num {
    font-family: 'IBM Plex Mono',monospace;
    font-size: 16px;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
}

/* ===== Cart FAB & drawer ===== */
.cart-fab {
    position: fixed;
    bottom: 22px;
    left: 22px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(32,38,44,.22);
    z-index: 50;
}

    .cart-fab .badge {
        background: var(--orange);
        border-radius: 50%;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'IBM Plex Mono',monospace;
        font-size: 12px;
    }

.drawer-bg {
    position: fixed;
    inset: 0;
    background: rgba(20,24,28,.45);
    display: none;
    z-index: 60;
    align-items: flex-end;
}

    .drawer-bg.visible {
        display: flex;
    }

.drawer {
    background: var(--surface);
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 18px 18px 0 0;
    padding: 24px 22px 28px;
    max-height: 82vh;
    overflow-y: auto;
    border-top: 1.5px solid var(--line-strong);
}

    .drawer h3 {
        margin: 0 0 16px;
        font-size: 18px;
        font-weight: 700;
        color: var(--ink);
    }

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

    .cart-item img {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        object-fit: cover;
        flex-shrink: 0;
        border: 1px solid var(--line-strong);
    }

    .cart-item .ci-info {
        flex: 1;
    }

    .cart-item .ci-name {
        font-size: 13.5px;
        font-weight: 700;
    }

    .cart-item .ci-size {
        font-size: 11.5px;
        color: var(--ink-2);
    }

    .cart-item .ci-price {
        font-family: 'IBM Plex Mono',monospace;
        font-size: 12.5px;
        color: var(--ink-2);
    }

    .cart-item .ci-qty {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cart-item .ci-remove {
        background: none;
        border: none;
        color: var(--thread);
        font-size: 18px;
        cursor: pointer;
        padding: 4px;
    }

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    margin: 18px 0;
    font-family: 'IBM Plex Mono',monospace;
    color: var(--ink);
}

.empty-cart {
    text-align: center;
    color: var(--ink-2);
    font-size: 13.5px;
    padding: 20px 0;
}

/* ===== Checkout ===== */
.field {
    margin-bottom: 16px;
}

    .field label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--ink-2);
    }

    .field input, .field select {
        width: 100%;
        padding: 11px 14px;
        border: 1.5px solid var(--line-strong);
        border-radius: 8px;
        background: var(--surface-2);
        font-family: inherit;
        font-size: 14.5px;
        color: var(--ink);
        outline: none;
    }

        .field input:focus, .field select:focus {
            border-color: var(--orange);
        }

.checkout-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}

.order-summary {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
}

    .order-summary .os-row {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        color: var(--ink-2);
    }

    .order-summary .os-total {
        display: flex;
        justify-content: space-between;
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px solid var(--line-strong);
        font-weight: 800;
        color: var(--ink);
        font-family: 'IBM Plex Mono',monospace;
    }

.validation-summary {
    background: var(--red-soft);
    color: var(--red);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ===== Gateway / success ===== */
.gateway-card {
    max-width: 380px;
    margin: 30px auto;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 16px;
    padding: 30px 26px;
    text-align: center;
}

.gateway-logo {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
}

.gateway-card h3 {
    font-size: 16px;
    margin: 0 0 4px;
}

.gateway-card .gw-sub {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-bottom: 20px;
}

.gateway-amount {
    font-family: 'IBM Plex Mono',monospace;
    font-size: 22px;
    font-weight: 800;
    margin: 16px 0 22px;
    color: var(--ink);
}

.success-check {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--green-ok);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 14px;
}

/* ===== Admin shell ===== */
#adminShell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--surface);
    border-left: 1.5px solid var(--line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 20px;
    border-bottom: 1.5px solid var(--line);
    margin-bottom: 16px;
}

    .sidebar-brand svg {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
    }

    .sidebar-brand .name {
        font-size: 14px;
        font-weight: 800;
    }

    .sidebar-brand .role {
        font-size: 11px;
        color: var(--ink-2);
    }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .nav-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .nav-item:hover {
        background: var(--surface-2);
        color: var(--ink);
    }

    .nav-item.active {
        background: var(--orange-soft);
        color: var(--orange-dark);
    }

.nav-spacer {
    flex: 1;
}

.main-area {
    flex: 1;
    min-width: 0;
    padding: 26px 30px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

    .topbar h2 {
        font-size: 20px;
        font-weight: 800;
        margin: 0;
    }

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

.stat-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
}

    .stat-card .label {
        font-size: 12.5px;
        color: var(--ink-2);
        font-weight: 600;
        margin-bottom: 8px;
    }

    .stat-card .value {
        font-size: 24px;
        font-weight: 800;
        font-family: 'IBM Plex Mono',monospace;
    }

.card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

    .card-head h3 {
        font-size: 15.5px;
        font-weight: 700;
        margin: 0;
    }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    text-align: right;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 12px;
    padding: 10px 8px;
    border-bottom: 1.5px solid var(--line);
}

tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

.prod-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.badge-green {
    background: var(--green-soft);
    color: var(--green-ok);
}

.badge-yellow {
    background: #FDF1D6;
    color: #8A6A05;
}

.badge-red {
    background: var(--red-soft);
    color: var(--red);
}

.badge-gray {
    background: var(--surface-2);
    color: var(--ink-2);
}

.row-actions {
    display: flex;
    gap: 6px;
}

.login-box {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    margin: 60px auto;
}

@media (max-width:860px) {
    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }

    #adminShell {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        border-left: none;
        border-bottom: 1.5px solid var(--line);
    }

    .sidebar-brand {
        display: none;
    }

    .nav-spacer {
        display: none;
    }

    .main-area {
        padding: 20px 16px 60px;
    }
}

@media print {
    .sidebar, .cart-fab, .no-print {
        display: none !important;
    }

    #adminShell {
        display: block;
    }

    .main-area {
        padding: 0;
    }

    body {
        background: #fff;
    }

    table {
        font-size: 12px;
    }

    .card {
        border: none;
        padding: 0;
    }
}
.site-footer {
    margin-top: 40px;
    padding: 28px 20px 100px;
    text-align: center;
    border-top: 1.5px solid var(--line);
    background: rgba(255,255,255,.5);
}

.footer-inner {
    max-width: 640px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 12px;
}

.footer-logo {
    width: 26px;
    height: 26px;
}

.footer-info {
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 2.1;
    margin-bottom: 12px;
}

.footer-copy {
    font-size: 11.5px;
    color: var(--ink-3);
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.size-guide-video {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    background: #000;
    display: block;
}
.pm-gallery {
    position: relative;
    max-width: 220px;
    margin: 0 auto 14px;
}

    .pm-gallery .pm-photo {
        margin: 0;
        cursor: zoom-in;
    }

.pm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pm-nav-prev {
    right: 6px;
}

.pm-nav-next {
    left: 6px;
}

.pm-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.pm-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line-strong);
}

    .pm-dot.active {
        background: var(--orange);
    }

.zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    cursor: zoom-out;
}

    .zoom-overlay.visible {
        display: flex;
    }

    .zoom-overlay img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 8px;
    }