:root {
    --brand-navy: #002c5f;
    --brand-navy-dark: #001f45;
    --brand-navy-light: #003d7a;
    --brand-orange: #ff7e00;
    --brand-orange-dark: #e06f00;
    --brand-orange-light: #ff9833;
    --bg: #f7f9fc;
    --section-bg: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #616161;
    --card-border: #e0e0e0;
    --glass-blur: blur(40px) saturate(200%);
    --glass-blur-light: blur(22px) saturate(180%);
    --container: 1200px;
    --header-offset: 180px;
    --mobile-nav-h: 64px;
    --admin-drawer: 280px;
    --admin-topbar: 72px;
    --font: "Vazirmatn", "Tahoma", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Author display rules (e.g. .stack { display:flex }) must not override HTML hidden */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

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

.page-main {
    min-height: 50vh;
    padding-block: 1.5rem 3rem;
}

    .page-main.with-mobile-nav {
        padding-bottom: calc(3rem + var(--mobile-nav-h));
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(145deg, rgba(255, 126, 0, 0.98), rgba(255, 126, 0, 0.82));
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 8px 24px rgba(255, 126, 0, 0.22);
}

    .btn-primary:hover {
        transform: translateY(-1px);
    }

.btn-outline {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 44, 95, 0.18);
    color: var(--brand-navy);
}

.btn-ghost {
    background: transparent;
    color: var(--brand-navy);
}

.muted {
    color: var(--text-secondary);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
/* مثلاً در CSS سایت */
@keyframes productsRise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 0.75rem;
}

    .grid-products .product-card {
        width: 100%;
        min-width: 0;
        animation: productsRise 0.35s ease both;
    }

@media (min-width: 768px) {
    .grid-products {
        grid-template-columns: repeat(auto-fill, 200px);
        justify-content: start;
        gap: 1.1rem;
    }

        .grid-products .product-card {
            width: 200px;
        }
}

.grid-products .product-card:nth-child(1) {
    animation-delay: 0.02s;
}

.grid-products .product-card:nth-child(2) {
    animation-delay: 0.04s;
}

.grid-products .product-card:nth-child(3) {
    animation-delay: 0.06s;
}

.grid-products .product-card:nth-child(4) {
    animation-delay: 0.08s;
}

.grid-products .product-card:nth-child(5) {
    animation-delay: 0.10s;
}

.product-card {
    overflow: hidden;
    width: 200px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 44, 95, 0.1);
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 -1px 0 rgba(0, 0, 0, 0.03) inset, 0 8px 28px rgba(0, 44, 95, 0.1);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 12px 36px rgba(0, 44, 95, 0.14);
    }

.product-card__media {
    aspect-ratio: 1;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
}

    .product-card__media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.product-card__body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.product-card__title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-navy);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.product-card__price {
    color: var(--brand-orange);
    font-weight: 800;
    margin-top: auto;
    text-align: center;
}

    .product-card__price .price-block {
        justify-content: center;
    }

    .product-card__price.is-muted {
        color: var(--text-secondary);
    }

.price-block {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.55rem;
}

.price-block__final {
    color: var(--brand-orange);
    font-weight: 800;
}

    .price-block__final.is-muted {
        color: var(--text-secondary);
    }

.price-block__old {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.86em;
    text-decoration: line-through;
}

.price-block__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 800;
}

.pdp-price .price-block__final {
    font-size: inherit;
    color: var(--text-primary);
}

.pdp-price .price-block__old {
    font-size: 0.72em;
}

.pdp-mobile-bar__price .price-block {
    gap: 0.15rem 0.4rem;
}

.pdp-mobile-bar__price .price-block__final {
    color: inherit;
    font-size: 0.95rem;
}

.pdp-mobile-bar__price .price-block__old {
    font-size: 0.72rem;
}

.pdp-mobile-bar__price .price-block__badge {
    font-size: 0.7rem;
    padding: 0.05rem 0.3rem;
}

.product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.product-card__actions {
    border-top: 1px solid rgba(0, 44, 95, 0.08);
    padding: 0.55rem;
    background: rgba(255, 255, 255, 0.72);
}

.btn-card-action {
    border-radius: 10px;
    font-size: 0.88rem;
    min-height: 42px;
    gap: 0.4rem;
}

.btn-card-action__icon {
    flex-shrink: 0;
    display: none;
}

.btn-card-action__label {
    line-height: 1.2;
}

.btn-contact {
    background: var(--brand-navy) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 24px rgba(0, 44, 95, 0.18);
}

    .btn-contact:hover {
        background: var(--brand-navy-dark) !important;
        transform: translateY(-1px);
    }

.btn-disabled,
.btn[disabled] {
    background-color: red !important;
    color: #fff !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    justify-content: center;
    flex-wrap: wrap;
}

.qty-stepper--spread {
    justify-content: space-between;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(0, 44, 95, 0.14);
    background: #fff;
    color: var(--brand-navy);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
}

.qty-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 800;
    color: var(--brand-navy);
}

.qty-total {
    font-weight: 700;
    color: var(--brand-orange);
    font-size: 0.9rem;
}

.cart-link {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-navy-light);
}

    .cart-link:hover {
        text-decoration: underline;
    }

/* PDP purchase box */
.pdp-layout {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 900px) {
    .pdp-layout {
        grid-template-columns: 1.2fr 0.9fr;
    }
}

.pdp-media {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

/* Product gallery + zoom + lightbox */
.pdp-gallery {
    display: grid;
    gap: 0.85rem;
}

.pdp-gallery__main {
    position: relative;
    min-height: 280px;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow: hidden;
    cursor: zoom-in;
    user-select: none;
}

@media (min-width: 768px) {
    .pdp-gallery__main {
        min-height: 360px;
        padding: 1.5rem;
    }
}

.pdp-gallery__image {
    max-width: 100%;
    max-height: min(52vh, 420px);
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.pdp-gallery__main.is-zooming .pdp-gallery__image {
    opacity: 0;
}

.pdp-gallery__zoom-pane {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 220%;
    z-index: 2;
}

.pdp-gallery__zoom-hint {
    position: absolute;
    inset-inline-end: 0.75rem;
    bottom: 0.75rem;
    z-index: 3;
    border: 1px solid rgba(0, 44, 95, 0.12);
    background: rgba(255, 255, 255, 0.88);
    color: var(--brand-navy);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.pdp-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pdp-gallery__thumb {
    width: 72px;
    height: 72px;
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: var(--glass-blur-light);
    cursor: pointer;
    overflow: hidden;
}

    .pdp-gallery__thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .pdp-gallery__thumb.is-active {
        border: 2px solid var(--brand-orange);
        background: rgba(255, 255, 255, 0.78);
    }

.pdp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
}

    .pdp-lightbox[hidden] {
        display: none !important;
    }

.pdp-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 20, 40, 0.72);
}

.pdp-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(960px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 1.5rem);
    display: grid;
    grid-template-rows: 1fr auto auto;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.pdp-lightbox__stage {
    min-height: 40vh;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.pdp-lightbox__img {
    max-width: 100%;
    max-height: min(70vh, 640px);
    object-fit: contain;
}

.pdp-lightbox__close {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.65rem;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 44, 95, 0.08);
    color: var(--brand-navy);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
}

.pdp-lightbox__nav {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 44, 95, 0.9);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 2;
}

.pdp-lightbox__nav--prev {
    inset-inline-start: 0.75rem;
}

.pdp-lightbox__nav--next {
    inset-inline-end: 0.75rem;
}

.pdp-lightbox__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.pdp-lightbox__thumb {
    width: 56px;
    height: 56px;
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 44, 95, 0.12);
    background: #fff;
    cursor: pointer;
}

    .pdp-lightbox__thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .pdp-lightbox__thumb.is-active {
        border-color: var(--brand-orange);
        box-shadow: 0 0 0 2px rgba(255, 126, 0, 0.25);
    }

.pdp-lightbox__counter {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

body.pdp-lightbox-open {
    overflow: hidden;
}

.pdp-purchase {
    position: relative;
    z-index: 1;
    align-self: start;
}

@media (min-width: 1024px) {
    .pdp-purchase {
        position: sticky;
        /* Stay below sticky site header (measured into --header-offset) */
        top: calc(var(--header-offset, 180px) + 12px);
        max-height: calc(100vh - var(--header-offset, 180px) - 24px);
        overflow: auto;
    }
}

.pdp-seller {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pdp-seller__name {
    font-weight: 800;
    color: var(--brand-navy);
}

.pdp-price {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.rich-text {
    color: var(--text-secondary);
    line-height: 1.75;
}

    .rich-text p {
        margin: 0 0 0.65rem;
    }

    .rich-text ul,
    .rich-text ol {
        margin: 0 0 0.65rem;
        padding-inline-start: 1.25rem;
    }

.pdp-stock-msg {
    color: #dc2626;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}

.pdp-actions-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .pdp-actions-desktop {
        display: block;
    }
}

.pdp-perks {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.pdp-perk {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.58);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.pdp-mobile-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    z-index: 1250;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid rgba(0, 44, 95, 0.08);
    box-shadow: 0 -12px 40px rgba(0, 44, 95, 0.1);
}

.pdp-mobile-bar__price {
    flex-shrink: 0;
    min-width: 0;
}

    .pdp-mobile-bar__price strong {
        color: var(--brand-orange);
        font-size: 0.95rem;
        white-space: nowrap;
    }

.pdp-mobile-bar__action {
    flex: 1;
    min-width: 0;
}

@media (min-width: 1024px) {
    .pdp-mobile-bar {
        display: none;
    }
}

body.has-pdp-mobile-bar .page-main.with-mobile-nav {
    padding-bottom: calc(2rem + var(--mobile-nav-h) + 72px + env(safe-area-inset-bottom, 0px));
}

body.has-pdp-mobile-bar .sticky-contact {
    bottom: calc(var(--mobile-nav-h) + 72px + env(safe-area-inset-bottom, 0px) + 0.5rem);
}

@media (min-width: 1024px) {
    body.has-pdp-mobile-bar .page-main.with-mobile-nav {
        padding-bottom: 3rem;
    }

    body.has-pdp-mobile-bar .sticky-contact {
        bottom: 1.25rem;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

    .field label {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--brand-navy);
    }

    .field input,
    .field select,
    .field textarea {
        border: 1px solid rgba(0, 44, 95, 0.16);
        border-radius: 12px;
        padding: 0.75rem 0.9rem;
        background: rgba(255, 255, 255, 0.85);
        outline: none;
    }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            border-color: var(--brand-orange);
            box-shadow: 0 0 0 3px rgba(255, 126, 0, 0.15);
        }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
}

.alert-error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-info {
    background: rgba(0, 44, 95, 0.06);
    color: var(--brand-navy);
    border: 1px solid rgba(0, 44, 95, 0.12);
}

.loading-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
    color: var(--brand-navy);
}

.spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(0, 44, 95, 0.15);
    border-top-color: var(--brand-orange);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.table-wrap {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    table.data-table th,
    table.data-table td {
        padding: 0.85rem 0.75rem;
        text-align: right;
        border-bottom: 1px solid rgba(0, 44, 95, 0.08);
    }

    table.data-table th {
        background: linear-gradient(135deg, rgba(0, 44, 95, 0.92), rgba(0, 44, 95, 0.82));
        color: #fff;
        font-weight: 800;
        white-space: nowrap;
    }

    table.data-table tr:nth-child(even) td {
        background: rgba(255, 255, 255, 0.42);
    }

    table.data-table tr:hover td {
        background: rgba(255, 126, 0, 0.08);
    }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-orange {
    background: rgba(255, 126, 0, 0.16);
    color: var(--brand-orange-dark);
}

.badge-navy {
    background: rgba(0, 44, 95, 0.1);
    color: var(--brand-navy);
}

.chip {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 44, 95, 0.12);
    font-size: 0.85rem;
    cursor: pointer;
}

    .chip.active {
        background: linear-gradient(145deg, rgba(255, 126, 0, 0.92), rgba(255, 126, 0, 0.78));
        color: #fff;
        border-color: transparent;
    }

.section-title {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0 0 0.5rem;
}

.section-sub {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
