

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

:root {
    --bg-dark: #121212;
    --card-dark: #1e1e1e;
    --border-dark: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-color: #ff9800;
    --accent-hover: #e68a00;
    --danger-color: #f44336;
    --success-color: #198754;
    --drawer-bg: #1c1c1e;
}

/* =========================================================
   Base
========================================================= */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Estedad', Tahoma, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.menu-dark {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding-bottom: 85px; /* فضای تنفس برای نوار شناور پایین */
}

body.drawer-is-open {
    overflow: hidden;
}

body,
button,
input,
select,
textarea {
    font-family: 'Estedad', Tahoma, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

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

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

.menu-header-nav {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 20px;
    overflow: visible;
}

.back-btn {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--accent-color);
}

.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow: visible;
}

.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.3s,
        transform 0.2s;
}

.action-btn:hover {
    background: var(--border-dark);
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.action-icon {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--danger-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    pointer-events: none;
}

/* =========================================================
   Visual Feedback Animations
========================================================= */

@keyframes cartBadgePulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    70% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

.cart-pulse-animate {
    animation: cartBadgePulse 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================================
   Card Action Box & Counter (+ 1 -)
========================================================= */

.card-action-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #252528;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 3px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInControl 0.2s ease-out;
}

@keyframes fadeInControl {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.card-qty-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: var(--accent-color);
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, transform 0.1s;
}

.card-qty-btn:active {
    transform: scale(0.9);
}

.card-qty-btn.minus {
    background: #333336;
    color: #fff;
}

.card-qty-btn.minus:hover {
    background: #444449;
}

.card-qty-btn.plus:hover {
    background: var(--accent-hover);
}

.card-qty-val {
    color: #ffffff;
    font-weight: bold;
    font-size: 15px;
    min-width: 25px;
    text-align: center;
}

/* =========================================================
   Floating Cart Bar (Bottom of screen)
========================================================= */

.floating-cart-bar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 999;
    max-width: 520px;
    margin: 0 auto;
    animation: slideUpFloat 0.3s ease-out;
}

@keyframes slideUpFloat {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-cart-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #252528;
    border: 1px solid #3c3c40;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border-radius: 14px;
    padding: 10px 16px;
}

.floating-cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.95rem;
}

.floating-cart-count {
    background: var(--accent-color);
    color: #000;
    font-weight: 800;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.floating-cart-divider {
    opacity: 0.4;
    margin: 0 2px;
}

.floating-cart-total {
    color: var(--accent-color);
    font-size: 1.05rem;
}

.floating-cart-action-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.floating-cart-action-btn:hover {
    background: var(--accent-hover);
}

.floating-cart-action-btn:active {
    transform: scale(0.96);
}

/* =========================================================
   Language Dropdown — Click Only
========================================================= */

.lang-switch-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: visible;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 10000;

    display: block;
    min-width: 155px;
    padding: 6px 0;

    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-6px);
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;
}

.lang-switch-container.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;

    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;

    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;

    transition:
        background-color 0.2s,
        color 0.2s;
}

.lang-dropdown a:hover,
.lang-dropdown a:focus-visible,
.lang-dropdown a.active {
    background: var(--border-dark);
    color: var(--accent-color);
}

.lang-dropdown a:focus-visible {
    outline: none;
}

.lang-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
    pointer-events: none;
}

html[dir="rtl"] .lang-dropdown a {
    text-align: right;
}

html[dir="ltr"] .lang-dropdown a {
    text-align: left;
}

/* =========================================================
   Topbar
========================================================= */

.topbar h1 {
    margin-top: 0;
    color: var(--text-primary);
}

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

.menu-layout-wrapper {
    display: flex;
    gap: 25px;
    margin-top: 20px;
    align-items: flex-start;
    overflow: visible !important;
}

html[dir="rtl"] .menu-layout-wrapper {
    flex-direction: row;
}

html[dir="ltr"] .menu-layout-wrapper {
    flex-direction: row-reverse;
}

/* =========================================================
   Sidebar Categories — Excel-like pinned behavior
========================================================= */

.category-sidebar {
    position: relative;
    width: 100px;
    min-width: 100px;
    flex: 0 0 100px;
    align-self: flex-start;
    overflow: visible;
}

.sidebar-sticky {
    position: relative;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    overscroll-behavior: contain;
    z-index: 200;
    padding: 15px 5px;
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
}

.sidebar-sticky.is-pinned {
    position: fixed !important;
    top: 16px !important;
    margin: 0 !important;
    max-height: calc(100vh - 32px);
    z-index: 500;
}

.sidebar-sticky.is-at-bottom {
    position: absolute !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar-sticky h3 {
    display: none;
}

.category-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-links li {
    width: 100%;
}

.category-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    transition: transform 0.2s;
}

.category-item-link:hover {
    transform: scale(1.05);
}

.category-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 65px;
    height: 65px;
    padding: 5px;
    overflow: hidden;
    background: #2a2a2a;
    border: 2px solid #333333;
    border-radius: 50%;
    transition:
        border-color 0.3s,
        transform 0.2s;
}

.category-item-link:hover .category-icon-wrapper,
.category-item-link.active .category-icon-wrapper {
    border-color: var(--accent-color);
}

.category-icon-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-name {
    display: block;
    max-width: 85px;
    overflow: hidden;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.menu-main-content {
    flex-grow: 1;
    min-width: 0;
}

.category-section {
    margin-bottom: 40px;
    scroll-margin-top: 24px;
}

.category-title {
    margin-bottom: 20px;
    padding-bottom: 8px;
    color: var(--accent-color);
    font-size: 20px;
    border-bottom: 2px solid var(--border-dark);
}

/* =========================================================
   Products Grid
========================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* =========================================================
   Product Card
========================================================= */

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-dark);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #111111;
}

.product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
    padding: 12px;
}

.product-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
}

.product-desc {
    height: 3em;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.product-price-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
}

.price-amount {
    font-size: 1.1rem;
}

.currency {
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.9;
}

.add-to-notes-btn {
    width: 100%;
    padding: 8px 14px;
    background: var(--accent-color);
    color: #000000;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease;
}

.add-to-notes-btn:hover {
    background: var(--accent-hover);
}

.add-to-notes-btn:active {
    transform: scale(0.96);
}

/* =========================================================
   Drawer / Overlay
========================================================= */

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.drawer-overlay.is-active {
    display: block;
}

.notes-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    width: 320px;
    background: var(--drawer-bg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-in-out;
}

html[dir="rtl"] .notes-drawer {
    left: 0;
    border-right: 1px solid var(--border-dark);
    transform: translateX(-100%);
}

html[dir="rtl"] .notes-drawer.is-open {
    transform: translateX(0);
}

html[dir="ltr"] .notes-drawer {
    right: 0;
    border-left: 1px solid var(--border-dark);
    transform: translateX(100%);
}

html[dir="ltr"] .notes-drawer.is-open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-dark);
}

.drawer-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-drawer-btn {
    padding: 0;
    background: none;
    color: var(--text-primary);
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.drawer-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.drawer-empty-message {
    padding: 40px 0;
    color: var(--text-secondary);
    text-align: center;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-dark);
}

.drawer-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.drawer-item-details {
    flex-grow: 1;
    min-width: 0;
}

.drawer-item-title {
    margin: 0 0 5px;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.drawer-item-price {
    color: var(--accent-color);
    font-size: 12px;
}

.drawer-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--border-dark);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
}

.qty-btn:hover {
    background: var(--accent-color);
    color: #000000;
}

.qty-val {
    min-width: 15px;
    font-size: 14px;
    text-align: center;
}

.drawer-footer {
    padding: 20px;
    background: var(--card-dark);
    border-top: 1px solid var(--border-dark);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 16px;
}

.total-row strong {
    color: var(--accent-color);
}

.clear-all-btn {
    width: 100%;
    padding: 10px;
    background: var(--danger-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 0.2s;
}

.clear-all-btn:hover {
    opacity: 0.9;
}

.notes-trigger-btn {
    position: relative;
}

.notes-trigger-btn .badge {
    top: -5px;
    right: -5px;
    padding: 2px 6px;
    font-size: 0.75rem;
}

/* =========================================================
   Responsive: Mobile
========================================================= */

@media (max-width: 768px) {
    .menu-header-nav {
        padding: 12px 0;
        margin-bottom: 14px;
    }

    .header-actions {
        gap: 14px;
    }

    .lang-dropdown {
        top: calc(100% + 8px);
        min-width: 150px;
    }

    .lang-dropdown a {
        min-height: 44px;
        padding: 11px 14px;
    }

    .menu-layout-wrapper {
        gap: 12px;
        margin-top: 12px;
    }

    .category-sidebar {
        width: 78px;
        min-width: 78px;
        flex: 0 0 78px;
        height: auto;
    }

    .sidebar-sticky {
        max-height: calc(100vh - 20px);
        padding: 10px 5px;
        border-radius: 12px;
    }

    .sidebar-sticky.is-pinned {
        top: 10px !important;
        max-height: calc(100vh - 20px);
    }

    .category-links {
        gap: 12px;
    }

    .category-icon-wrapper {
        width: 52px;
        height: 52px;
        padding: 4px;
    }

    .category-name {
        max-width: 70px;
        font-size: 10px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-card {
        flex-direction: row;
        align-items: stretch;
    }

    .product-image {
        width: 92px;
        height: auto;
        min-height: 92px;
        flex-shrink: 0;
    }

    .product-content {
        justify-content: space-between;
        gap: 6px;
        padding: 8px 10px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-desc {
        height: auto;
        max-height: 36px;
        font-size: 11px;
        line-height: 1.45;
    }

    .product-price-action {
        margin-top: 0;
    }

    .product-price {
        font-size: 13px;
    }

    .add-to-notes-btn {
        padding: 5px 10px;
        border-radius: 8px;
        font-size: 11px;
    }

    .notes-drawer {
        width: 92%;
        max-width: 320px;
    }
}

/* =========================================================
   Extra Small Phones
========================================================= */

@media (max-width: 420px) {
    .menu-layout-wrapper {
        gap: 10px;
    }

    .category-sidebar {
        width: 72px;
        min-width: 72px;
        flex-basis: 72px;
    }

    .category-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .category-name {
        max-width: 64px;
        font-size: 9px;
    }

    .product-image {
        width: 84px;
        min-height: 84px;
    }

    .product-title {
        font-size: 13px;
    }

    .product-desc {
        max-height: 32px;
    }

    .header-actions {
        gap: 10px;
    }

    .action-btn {
        width: 42px;
        height: 42px;
    }

    .lang-dropdown {
        min-width: 145px;
    }
}

/* =========================================================
   Devices Without Real Hover
========================================================= */

@media (hover: none) and (pointer: coarse) {
    .action-btn:hover {
        background: var(--card-dark);
    }

    .lang-dropdown a:hover {
        background: transparent;
        color: var(--text-primary);
    }

    .lang-dropdown a.active {
        background: var(--border-dark);
        color: var(--accent-color);
    }

    .product-card:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .category-item-link:hover {
        transform: none;
    }

    .add-to-notes-btn:hover {
        background: var(--accent-color);
    }
}

/* =========================================================
   Checkout Modal
========================================================= */

.checkout-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999;
}

.checkout-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    color: #222222;
    border-radius: 18px;
    padding: 24px;
    direction: rtl;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.checkout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.checkout-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111111;
}

.close-checkout-modal {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f1f1;
    color: #222;
    font-size: 20px;
    cursor: pointer;
    flex: 0 0 auto;
}

.close-checkout-modal:hover {
    background: #e5e5e5;
}

.checkout-modal .form-group {
    margin-bottom: 16px;
}

.checkout-modal label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
}

.checkout-modal .form-control,
.checkout-modal input,
.checkout-modal textarea,
.checkout-modal select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    background: #fff;
    color: #222;
    font-size: 14px;
    outline: none;
}

.checkout-modal .form-control:focus,
.checkout-modal input:focus,
.checkout-modal textarea:focus,
.checkout-modal select:focus {
    border-color: #d4a017;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.checkout-modal textarea {
    min-height: 110px;
    resize: vertical;
}

.checkout-modal .form-control::placeholder,
.checkout-modal input::placeholder,
.checkout-modal textarea::placeholder {
    color: #999;
}

.checkout-modal .submit-order-btn,
.submit-order-btn,
.checkout-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    background: #d4a017;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-bottom: 10px;
}

.checkout-modal .submit-order-btn:hover,
.checkout-btn:hover {
    background: #bf8f14;
}

.checkout-modal .submit-order-btn:disabled,
.checkout-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

body.checkout-modal-open {
    overflow: hidden;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

.modal-close-btn:active {
    transform: scale(0.96);
}

.product-price-action .original-price {
    display: block;
    color: #999 !important;
    font-size: 0.8em;
    font-weight: normal;
    text-decoration: line-through !important;
    text-decoration-thickness: 1px;
}

.product-price-action .discount-price {
    display: block;
    color: #ffcc33 !important;
    font-size: 1.1em;
    font-weight: bold;
}

.product-price-action .normal-price {
    display: block;
    font-weight: bold;
}

/* =========================================================
   Active category while scrolling
========================================================= */
.category-item-link.active .category-icon-wrapper {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.18);
    transform: scale(1.04);
}

.category-item-link.active .category-name {
    color: var(--accent-color) !important;
}

.category-item-link.active {
    opacity: 1;
}
/* =========================================================
   استایل مرتب‌سازی خلاصه فاکتور و روش‌های پرداخت
========================================================= */

/* باکس خلاصه فاکتور شبیه مانلی */
.invoice-summary-box {
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.invoice-summary-box strong {
    display: none; /* مخفی کردن تیتر تکراری داخل باکس */
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.summary-row strong {
    display: inline-block !important;
    color: #111827;
    font-weight: 700;
}

.summary-row.final-row {
    border-top: 1px dashed #d1d5db;
    margin-top: 8px;
    padding-top: 14px;
}

.summary-row.final-row span {
    font-weight: 700;
    color: #111827;
}

.summary-row.final-row strong {
    color: #d4a017;
    font-size: 1.15rem;
}

/* دو ستونه و کادربندی کردن روش‌های پرداخت */
.payment-method-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.payment-method-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    user-select: none;
}

.payment-method-choice:hover {
    border-color: #d4a017;
    background: #fffdf5;
}

.payment-method-choice.is-selected {
    border-color: #d4a017;
    background: #fff9e6;
    box-shadow: 0 0 0 1px #d4a017;
}

.payment-method-choice input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #d4a017;
    cursor: pointer;
}

.payment-method-choice-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
}

.payment-method-choice-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-method-discount-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.payment-method-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
}

/* تنظیم ریسپانسیو برای صفحات خیلی باریک */
@media (max-width: 480px) {
    .payment-method-options {
        grid-template-columns: 1fr;
    }
}

/* وضعیت خطای اعتبارسنجی در فرم تسویه */
.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

.field-error-text {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

.form-group {
    position: relative;
}

.store-closed-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #ff6b6b;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.store-closed-icon {
    font-size: 1.1rem;
}
.product-unavailable-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    background: #252528;
    border: 1px solid #38383c;
    border-radius: 8px;
    user-select: none;
}