/* =========================================
   Fonts
========================================= */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}


/* =========================================
   CSS Variables
========================================= */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.10);
    --background: #f5f7fb;
    --surface: #ffffff;
    --border: rgba(15, 23, 42, 0.10);
    --text: #1e293b;
    --muted: #64748b;

    /* توکن‌های مشترکِ لایه‌ی کامپوننت (دکمه/هشدار/فرم/…)؛
       صفحات جدید فقط از همین‌ها استفاده می‌کنند تا هم‌زبانیِ بصری حفظ شود. */
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-soft: rgba(239, 68, 68, 0.08);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.10);
    --warning: #b45309;
    --warning-soft: rgba(217, 119, 6, 0.10);

    --radius: 16px;
    --radius-sm: 11px;

    --shadow-sm: 0 8px 30px rgba(15, 23, 42, 0.045);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.09);

    --skeleton-1: #eceef3;
    --skeleton-2: #f6f7fa;
}


/* =========================================
   Reset
========================================= */

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


html {
    margin: 0;
    padding: 0;
    min-height: 100%;

    font-family:
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    direction: rtl;

    background: #f5f7fb;

    color: #172033;

    scroll-behavior: smooth;
}


body {
    margin: 0;
    padding: 0;
    min-height: 100vh;

    font-family:
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    background:
        #f5f7fb;

    color: #172033;

    line-height: 1.7;

    transition:
        background-color .25s ease,
        color .25s ease;
}


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


button,
a {
    -webkit-tap-highlight-color: transparent;
}


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


button {
    border: 0;
}


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


/* =========================================
   Utility
========================================= */

.hidden {
    display: none !important;
}


/* =========================================
   Navbar
========================================= */

.navbar {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    background:
        rgba(255, 255, 255, .86);

    border-bottom:
        1px solid rgba(15, 23, 42, .08);

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    transition:
        background-color .25s ease,
        border-color .25s ease;
}


.navbar-container {
    width: min(
        calc(100% - 40px),
        1180px
    );

    min-height: 76px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    gap: 30px;
}


/* =========================================
   Brand
========================================= */

.brand {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-size: 20px;

    font-weight: 900;

    letter-spacing: -.4px;

    color: #111827;

    white-space: nowrap;

    transition:
        color .2s ease,
        transform .2s ease;
}


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


.brand::before {
    content: "";

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background:
        #6366f1;

    box-shadow:
        0 0 0 5px
        rgba(99, 102, 241, .12);
}


/* =========================================
   Navigation
========================================= */

.nav-links {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-right: 10px;
}


.nav-links a {
    padding:
        8px
        14px;

    border-radius: 10px;

    color: #64748b;

    font-size: 14px;

    font-weight: 600;

    transition:
        background-color .2s ease,
        color .2s ease;
}


.nav-links a:hover {
    background:
        rgba(99, 102, 241, .08);

    color:
        #4f46e5;
}


/* =========================================
   Nav Actions
========================================= */

.nav-actions {
    display: flex;

    align-items: center;

    gap: 9px;

    margin-right: auto;
}


.icon-button,
.cart-button,
.account-button,
.login-button {
    min-height: 42px;

    border-radius: 12px;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}


.icon-button {
    width: 42px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    background:
        #f1f5f9;

    color:
        #334155;

    font-size: 17px;

    transition:
        background-color .2s ease,
        color .2s ease;
}


.icon-button:hover,
.cart-button:hover,
.account-button:hover,
.login-button:hover {
    transform:
        translateY(-1px);
}


/* =========================================
   Cart Button
========================================= */

.cart-button {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding:
        0 13px;

    cursor: pointer;

    background:
        #f1f5f9;

    color:
        #334155;

    transition:
        background-color .2s ease,
        color .2s ease;
}


.cart-icon {
    font-size: 17px;
}


.cart-label {
    font-size: 13px;

    font-weight: 700;
}


.cart-count {
    min-width: 22px;

    height: 22px;

    padding:
        0 6px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border-radius: 999px;

    background:
        #6366f1;

    color:
        white;

    font-size: 11px;

    font-weight: 800;
}


/* =========================================
   Account / Login
========================================= */

.account-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding:
        0 14px;

    border:
        1px solid rgba(99, 102, 241, .16);

    background:
        rgba(99, 102, 241, .06);

    color:
        #4f46e5;

    font-size: 13px;

    font-weight: 700;
}


.login-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding:
        0 15px;

    background:
        #6366f1;

    color:
        white;

    font-size: 13px;

    font-weight: 700;

    box-shadow:
        0 7px 18px
        rgba(99, 102, 241, .18);
}


/* =========================================
   Main
========================================= */

main {
    width: 100%;
}


/* =========================================
   Loading
========================================= */

.loading {
    width: 100%;

    min-height: 180px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 13px;

    color:
        #64748b;

    font-size: 14px;
}


.loading-spinner {
    width: 32px;
    height: 32px;

    border:
        3px solid
        rgba(99, 102, 241, .15);

    border-top-color:
        #6366f1;

    border-radius: 50%;

    animation:
        spin .75s linear infinite;
}


@keyframes spin {

    to {
        transform:
            rotate(360deg);
    }

}


/* =========================================
   Error
========================================= */

.error-message {
    width: min(
        calc(100% - 40px),
        1180px
    );

    margin:
        25px auto;

    padding:
        16px
        18px;

    border:
        1px solid
        rgba(239, 68, 68, .15);

    border-radius: 14px;

    background:
        rgba(239, 68, 68, .06);

    color:
        #dc2626;

    text-align: center;

    font-size: 14px;

    font-weight: 600;
}


/* =========================================
   Cart Overlay
========================================= */

.cart-overlay {
    position: fixed;

    inset: 0;

    z-index: 1990;

    background:
        rgba(15, 23, 42, .42);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .25s ease,
        visibility .25s ease;

    backdrop-filter:
        blur(3px);
}


.cart-overlay.active {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}


/* =========================================
   Cart Sidebar
========================================= */

.cart-sidebar {
    position: fixed;

    top: 0;

    right: 0;

    z-index: 2000;

    width: min(
        430px,
        92vw
    );

    height: 100vh;

    display: flex;

    flex-direction: column;

    background:
        #ffffff;

    border-left:
        1px solid
        rgba(15, 23, 42, .08);

    box-shadow:
        -20px 0 60px
        rgba(15, 23, 42, .12);

    transform:
        translateX(105%);

    visibility: hidden;

    transition:
        transform .3s cubic-bezier(.22,.61,.36,1),
        visibility .3s ease;
}


.cart-sidebar.active {
    transform:
        translateX(0);

    visibility: visible;
}


/* =========================================
   Cart Header
========================================= */

.cart-header {
    min-height: 82px;

    padding:
        18px
        22px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid
        rgba(15, 23, 42, .07);
}


.cart-header h2 {
    margin: 0;

    font-size: 18px;

    font-weight: 800;
}


.cart-header span {
    display: block;

    margin-top: 2px;

    color:
        #94a3b8;

    font-size: 12px;
}


.close-cart {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 10px;

    background:
        #f1f5f9;

    color:
        #475569;

    cursor: pointer;

    font-size: 24px;

    line-height: 1;

    transition:
        background-color .2s ease,
        color .2s ease;
}


.close-cart:hover {
    background:
        #e2e8f0;

    color:
        #0f172a;
}


/* =========================================
   Cart Loading
========================================= */

.cart-loading {
    padding:
        30px 20px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 12px;

    color:
        #64748b;

    font-size: 13px;
}


/* =========================================
   Cart Empty
========================================= */

.cart-empty {
    flex: 1;

    padding:
        35px 20px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    color:
        #64748b;
}


.cart-empty.hidden {
    display: none;
}


.empty-cart-icon {
    width: 64px;
    height: 64px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 15px;

    border-radius: 18px;

    background:
        #f1f5f9;

    font-size: 27px;
}


.cart-empty h3 {
    margin:
        0 0 6px;

    color:
        #1e293b;

    font-size: 16px;
}


.cart-empty p {
    margin: 0;

    font-size: 13px;

    color:
        #94a3b8;
}


/* =========================================
   Cart Items
========================================= */

.cart-items {
    flex: 1;

    min-height: 0;

    padding:
        16px 18px;

    overflow-y: auto;
}


.cart-item {
    padding:
        15px;

    margin-bottom:
        12px;

    border:
        1px solid
        rgba(15, 23, 42, .07);

    border-radius: 15px;

    background:
        #f8fafc;
}


.cart-item-top {
    display: flex;

    align-items: center;

    gap: 12px;
}


.cart-item-flag {
    width: 34px;
    height: 25px;

    object-fit: cover;

    border-radius: 6px;

    box-shadow:
        0 2px 7px
        rgba(15, 23, 42, .10);
}


.cart-item-info {
    display: flex;

    flex-direction: column;

    gap: 2px;
}


.cart-item-info strong {
    color:
        #1e293b;

    font-size: 14px;

    font-weight: 800;
}


.cart-item-info small {
    color:
        #94a3b8;

    font-size: 11px;
}


.cart-price-section {
    margin-top: 13px;

    display: flex;

    flex-direction: column;

    gap: 4px;
}


.cart-original-price {
    color:
        #94a3b8;

    font-size: 11px;

    text-decoration: line-through;
}


.cart-discount {
    color:
        #16a34a;

    font-size: 11px;

    font-weight: 700;
}


.cart-item-price {
    color:
        #4f46e5;

    font-size: 15px;

    font-weight: 900;
}


.cart-item-bottom {
    margin-top: 13px;

    padding-top: 12px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-top:
        1px solid
        rgba(15, 23, 42, .06);
}


.quantity-control {
    display: inline-flex;

    align-items: center;

    gap: 10px;

    padding:
        4px;

    border:
        1px solid
        rgba(15, 23, 42, .08);

    border-radius: 10px;

    background:
        #ffffff;
}


.quantity-control button {
    width: 28px;
    height: 28px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 7px;

    background:
        #f1f5f9;

    color:
        #334155;

    cursor: pointer;

    font-size: 17px;
}


.quantity-control span {
    min-width: 20px;

    text-align: center;

    color:
        #1e293b;

    font-size: 12px;

    font-weight: 800;
}


.remove-item {
    padding:
        7px 10px;

    border-radius: 8px;

    background:
        rgba(239, 68, 68, .07);

    color:
        #dc2626;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 700;
}


/* =========================================
   Cart Footer
========================================= */

.cart-footer {
    padding:
        18px 20px;

    border-top:
        1px solid
        rgba(15, 23, 42, .07);

    background:
        #ffffff;
}


.cart-total {
    margin-bottom:
        13px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    color:
        #64748b;

    font-size: 13px;
}


.cart-total strong {
    color:
        #111827;

    font-size: 16px;

    font-weight: 900;
}


.checkout-button {
    min-height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        #6366f1;

    color:
        white;

    font-size: 13px;

    font-weight: 800;

    box-shadow:
        0 8px 22px
        rgba(99, 102, 241, .20);

    transition:
        transform .2s ease,
        background-color .2s ease;
}


.checkout-button:hover {
    transform:
        translateY(-1px);

    background:
        #4f46e5;
}


/* =========================================
   Footer
========================================= */

.site-footer {
    margin-top:
        80px;

    border-top:
        1px solid
        rgba(15, 23, 42, .07);

    background:
        #ffffff;
}


.footer-container {
    width: min(
        calc(100% - 40px),
        1180px
    );

    margin:
        0 auto;
}


.footer-grid {
    padding:
        55px 0 45px;

    display: grid;

    grid-template-columns:
        1.7fr
        1fr
        1fr
        1.35fr;

    gap: 45px;
}


.footer-brand-col {
    min-width: 0;
}


.footer-logo {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    color:
        #111827;

    font-size: 21px;

    font-weight: 900;

    letter-spacing: -.5px;
}


.footer-logo span {
    color:
        #6366f1;
}


.footer-desc {
    max-width: 340px;

    margin:
        15px 0 0;

    color:
        #64748b;

    font-size: 12px;

    line-height: 2;
}


.footer-social {
    margin-top:
        20px;

    display: flex;

    align-items: center;

    gap: 8px;
}


.social-link {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid
        rgba(15, 23, 42, .08);

    border-radius: 10px;

    background:
        #f8fafc;

    color:
        #64748b;

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease;
}


.social-link:hover {
    transform:
        translateY(-2px);

    color:
        #6366f1;

    border-color:
        rgba(99, 102, 241, .20);

    background:
        rgba(99, 102, 241, .06);
}


.footer-title {
    margin:
        2px 0 17px;

    color:
        #1e293b;

    font-size: 14px;

    font-weight: 800;
}


.footer-links {
    margin: 0;

    padding: 0;

    list-style: none;

    display: flex;

    flex-direction: column;

    gap: 9px;
}


.footer-links a {
    color:
        #64748b;

    font-size: 12px;

    transition:
        color .2s ease,
        padding-right .2s ease;
}


.footer-links a:hover {
    padding-right: 4px;

    color:
        #6366f1;
}


/* =========================================
   Newsletter
========================================= */

.newsletter-form {
    margin-top:
        16px;

    display: flex;

    gap: 7px;
}


.newsletter-form input {
    width: 0;

    min-width: 0;

    flex: 1;

    height: 42px;

    padding:
        0 12px;

    outline: none;

    border:
        1px solid
        rgba(15, 23, 42, .09);

    border-radius: 10px;

    background:
        #f8fafc;

    color:
        #1e293b;

    font-size: 12px;
}


.newsletter-form input:focus {
    border-color:
        rgba(99, 102, 241, .35);
}


.newsletter-form button {
    height: 42px;

    padding:
        0 14px;

    border-radius: 10px;

    background:
        #6366f1;

    color:
        white;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 800;
}


.footer-contact-row {
    margin-top:
        15px;

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 6px;

    color:
        #94a3b8;

    font-size: 11px;
}


.footer-contact-row a {
    color:
        #6366f1;
}


/* =========================================
   Footer Bottom
========================================= */

.footer-bottom {
    min-height: 65px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    border-top:
        1px solid
        rgba(15, 23, 42, .07);
}


.copyright {
    margin: 0;

    color:
        #94a3b8;

    font-size: 11px;
}


.footer-bottom-links {
    display: flex;

    align-items: center;

    gap: 9px;

    color:
        #94a3b8;

    font-size: 11px;
}


.footer-bottom-links a {
    transition:
        color .2s ease;
}


.footer-bottom-links a:hover {
    color:
        #6366f1;
}


.footer-bottom-links .dot {
    opacity: .5;
}


/* =========================================
   Dark Mode
========================================= */

html.dark {
    /* بازتعریف توکن‌های تم برای دارک‌مود
       (مقادیر لایت‌مود در :root تعریف شده‌اند).
       بدون این‌ها، متن‌ها و سطوحی که در فایل‌های
       صفحات از var(--text)/var(--surface)/... استفاده
       می‌کنند در دارک‌مود روشن/نامرئی می‌مانند. */
    --background: #111827;
    --surface: #1a2236;
    --border: #283548;
    --text: #e2e8f0;
    --muted: #94a3b8;

    /* بازتعریفِ توکن‌های لایه‌ی کامپوننت برای دارک‌مود */
    --primary-soft: rgba(99, 102, 241, 0.16);
    --danger: #f87171;
    --danger-hover: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --success: #4ade80;
    --success-soft: rgba(22, 163, 74, 0.16);
    --warning: #fbbf24;
    --warning-soft: rgba(217, 119, 6, 0.16);

    --shadow-sm: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.20);

    --skeleton-1: #1c2536;
    --skeleton-2: #232d42;

    background:
        #0b1120;

    color:
        #e5e7eb;
}


html.dark body {
    background:
        #0b1120;

    color:
        #e5e7eb;
}


/* Navbar */

html.dark .navbar {
    background:
        rgba(11, 17, 32, .86);

    border-bottom-color:
        rgba(255, 255, 255, .07);
}


html.dark .brand {
    color:
        #f8fafc;
}


html.dark .nav-links a {
    color:
        #94a3b8;
}


html.dark .nav-links a:hover {
    background:
        rgba(99, 102, 241, .12);

    color:
        #a5b4fc;
}


html.dark .icon-button,
html.dark .cart-button {
    background:
        rgba(255, 255, 255, .06);

    color:
        #cbd5e1;
}


html.dark .account-button {
    background:
        rgba(99, 102, 241, .10);

    border-color:
        rgba(129, 140, 248, .18);

    color:
        #a5b4fc;
}


/* Cart */

html.dark .cart-sidebar {
    background:
        #111827;

    border-left-color:
        rgba(255, 255, 255, .07);

    box-shadow:
        -20px 0 60px
        rgba(0, 0, 0, .35);
}


html.dark .cart-header {
    border-bottom-color:
        rgba(255, 255, 255, .07);
}


html.dark .cart-header h2 {
    color:
        #f8fafc;
}


html.dark .cart-header span {
    color:
        #64748b;
}


html.dark .close-cart {
    background:
        rgba(255, 255, 255, .06);

    color:
        #cbd5e1;
}


html.dark .close-cart:hover {
    background:
        rgba(255, 255, 255, .12);

    color:
        #f8fafc;
}


html.dark .cart-item {
    border-color:
        rgba(255, 255, 255, .07);

    background:
        #0f172a;
}


html.dark .cart-item-info strong {
    color:
        #f1f5f9;
}


html.dark .cart-item-info small {
    color:
        #64748b;
}


html.dark .cart-item-price {
    color:
        #a5b4fc;
}


html.dark .quantity-control {
    border-color:
        rgba(255, 255, 255, .07);

    background:
        #111827;
}


html.dark .quantity-control button {
    background:
        rgba(255, 255, 255, .06);

    color:
        #cbd5e1;
}


html.dark .quantity-control span {
    color:
        #e2e8f0;
}


html.dark .cart-item-bottom {
    border-top-color:
        rgba(255, 255, 255, .06);
}


html.dark .cart-footer {
    border-top-color:
        rgba(255, 255, 255, .07);

    background:
        #111827;
}


html.dark .cart-total {
    color:
        #94a3b8;
}


html.dark .cart-total strong {
    color:
        #f8fafc;
}


html.dark .empty-cart-icon {
    background:
        rgba(255, 255, 255, .05);
}


html.dark .cart-empty h3 {
    color:
        #e2e8f0;
}


/* Footer */

html.dark .site-footer {
    border-top-color:
        rgba(255, 255, 255, .07);

    background:
        #0f172a;
}


html.dark .footer-logo {
    color:
        #f8fafc;
}


html.dark .footer-desc,
html.dark .footer-links a,
html.dark .copyright,
html.dark .footer-bottom-links {
    color:
        #64748b;
}


html.dark .footer-title {
    color:
        #e2e8f0;
}


html.dark .social-link {
    border-color:
        rgba(255, 255, 255, .07);

    background:
        rgba(255, 255, 255, .04);

    color:
        #94a3b8;
}


html.dark .social-link:hover {
    background:
        rgba(99, 102, 241, .10);

    border-color:
        rgba(129, 140, 248, .18);

    color:
        #a5b4fc;
}


html.dark .newsletter-form input {
    border-color:
        rgba(255, 255, 255, .07);

    background:
        rgba(255, 255, 255, .04);

    color:
        #e2e8f0;
}


html.dark .footer-bottom {
    border-top-color:
        rgba(255, 255, 255, .07);
}


/* =========================================
   Responsive
========================================= */

@media (max-width: 900px) {

    .navbar-container {
        width:
            min(
                calc(100% - 28px),
                1180px
            );

        gap: 15px;
    }


    .nav-links {
        display: none;
    }


    .cart-label {
        display: none;
    }


    .footer-grid {
        grid-template-columns:
            1.4fr
            1fr
            1fr;
    }


    .footer-brand-col {
        grid-column:
            1 / -1;
    }


    .footer-desc {
        max-width:
            600px;
    }

}


@media (max-width: 650px) {

    .navbar-container {
        min-height:
            68px;
    }


    .brand {
        font-size:
            17px;
    }


    .nav-actions {
        gap: 6px;
    }


    .account-button {
        display: none;
    }


    .login-button {
        padding:
            0 11px;

        font-size:
            11px;
    }


    .footer-grid {
        padding:
            40px 0 35px;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap:
            35px 25px;
    }


    .footer-brand-col {
        grid-column:
            1 / -1;
    }


    .footer-contact {
        grid-column:
            1 / -1;
    }


    .footer-bottom {
        min-height:
            auto;

        padding:
            18px 0;

        flex-direction:
            column;

        align-items:
            flex-start;

        gap:
            7px;
    }

}


@media (max-width: 430px) {

    .navbar-container {
        width:
            calc(100% - 20px);
    }


    .icon-button {
        width:
            38px;

        min-width:
            38px;
    }


    .cart-button {
        min-width:
            42px;

        padding:
            0 10px;

        justify-content:
            center;
    }


    .cart-count {
        min-width:
            20px;

        height:
            20px;
    }


    .footer-container {
        width:
            calc(100% - 28px);
    }


    .footer-grid {
        grid-template-columns:
            1fr;
    }


    .footer-brand-col,
    .footer-contact {
        grid-column:
            auto;
    }


    .footer-bottom-links {
        flex-wrap:
            wrap;
    }

}


/* =========================================================================
   Shared Component Layer
   لایه‌ی کامپوننت‌های مشترک: دکمه‌ها، هشدارها، فیلدهای فرم، حالت‌های خالی و
   اسکلتون. صفحات جدید (قوانین، داشبورد پشتیبان‌گیری، کارت محصولات) فقط از این
   کلاس‌ها و توکن‌های :root استفاده می‌کنند. افزودنی است و صفحات موجود را
   دست‌کاری نمی‌کند.
========================================================================= */

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 11px 20px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    background: transparent;
    color: var(--text);

    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .12s ease,
        box-shadow .2s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn:disabled,
.btn[disabled],
.btn.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

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

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-danger:hover {
    background: var(--danger-hover);
}

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

.btn-ghost:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 12.5px;
}


/* --- Alerts --- */

.alert {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.7;
}

.alert + .alert {
    margin-top: 12px;
}

.alert-success {
    border-color: rgba(22, 163, 74, .28);
    background: var(--success-soft);
    color: var(--success);
}

.alert-error {
    border-color: rgba(239, 68, 68, .28);
    background: var(--danger-soft);
    color: var(--danger);
}

.alert-warning {
    border-color: rgba(217, 119, 6, .30);
    background: var(--warning-soft);
    color: var(--warning);
}

.alert-info {
    border-color: rgba(59, 130, 246, .28);
    background: var(--info-soft, var(--surface));
    color: var(--info, var(--text));
}


/* --- Form fields --- */

.field {
    display: block;
    margin-bottom: 16px;
}

.field > label,
.field > span {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field input[type="url"],
.field textarea,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);
    color: var(--text);

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.8;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.field .field-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

/* چک‌باکسِ کنارِ متن (پذیرشِ قوانین و…) */
.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);

    cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-field span {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.7;
}


/* --- Empty state --- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 54px 24px;

    border: 1px dashed var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    text-align: center;
}

.empty-state .empty-state-icon {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 6px;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 26px;
}

.empty-state h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}


/* --- Skeleton --- */

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--skeleton-1);
    border-radius: 8px;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        var(--skeleton-2),
        transparent
    );
    animation: skeleton-shine 1.3s ease-in-out infinite;
}

/* RTL: نور از سمتِ مقابل حرکت کند */
html[dir="rtl"] .skeleton::after {
    animation-direction: reverse;
}

@keyframes skeleton-shine {
    100% {
        transform: translateX(100%);
    }
}


/* --- Surface card + overflow guards --- */

.surface-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    max-width: 100%;
}