:root {
    --primary: #C1272D;      /* أحمر غامق مثل HAAT */
    --primary-dark: #A02025;
    --primary-light: #E53935;
    --background: #FAFAFA;   /* رمادي فاتح جداً */
    --white: #fff;
    --text-dark: #222;
    --text-light: #fff;
    --success: #43A047;
    --error: #C1272D;
    --info: #1976D2;
    --warning: #FFB300;
    --border: #E0E0E0;
    --radius: 16px;
    --danger: #dc3545;
    --secondary: #FFB300; /* برتقالي ذهبي */
}

html, body {
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
body {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--background);
    color: var(--text-dark);
    font-family: 'Tajawal', system-ui, sans-serif;
    margin: 0;
    padding-bottom: 100px;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.main-content {
    flex: 1 0 auto;
    padding-bottom: 110px; /* مساحة للزر العائم والفوتر */
    overflow-x: hidden;
    position: relative;
}

/* شريط علوي عصري */
.top-nav {
    background: var(--white);
    border-bottom: 1.5px solid #eee;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}

.top-nav .brand-name {
    color: var(--secondary);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.top-nav .nav-icon {
    position: absolute;
    right: 18px;
    font-size: 1.3rem;
    color: var(--primary);
    cursor: pointer;
}

/* إخفاء شريط التصنيفات القديم */
.categories-bar {
    display: none !important;
}

.categories-bar::-webkit-scrollbar {
    height: 5px;
}

.categories-bar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.category-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px 10px 22px;
    margin: 0 2px;
    border: none;
    background: none;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1.13rem;
    border-bottom: 2.5px solid transparent;
    border-radius: 0;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
    position: relative;
}

.category-btn.active, .category-btn:focus {
    color: var(--primary);
    border-bottom: 2.5px solid var(--primary);
    background: none;
}

.category-btn.active::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.2s;
}

.category-btn i {
    font-size: 1.35rem;
}

/* بطاقات المنتجات */
.product-list-item {
    cursor: pointer;
    touch-action: manipulation;
}

.product-list-item .bg-white {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid #eee;
    padding: 18px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    min-height: 90px;
}

.product-list-item .bg-white:active {
    transform: scale(0.98);
}

.product-list-item .bg-white:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(255,112,67,0.07);
}

.product-list-item img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    border: 1.5px solid #eee;
}

.product-title {
    font-size: 1.13rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 2px;
}

.product-list-item .text-muted {
    color: var(--secondary);
    font-size: 0.98rem;
    opacity: 0.8;
    margin-bottom: 2px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    color: var(--primary);
    font-size: 1.08rem;
    font-weight: bold;
    background: #FFF3E0;
    border-radius: 8px;
    padding: 2px 12px;
    display: inline-block;
}

.product-list-item .btn-outline-primary, .product-list-item .btn-primary {
    border-radius: 50px;
    min-width: 48px;
    min-height: 48px;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    transition: background 0.2s, color 0.2s;
    margin-right: 8px;
}

.product-list-item .btn-primary, .product-list-item .btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

/* تحسين Bottom Sheet/Modal والخيارات */
.product-option-group {
    background: #f9f9f9;
    border-radius: 14px;
    padding: 18px 12px 14px 12px;
    margin-bottom: 22px;
    border: 1.5px solid #eee;
    box-shadow: 0 2px 10px rgba(52,52,52,0.04);
    position: relative;
}
.product-option-group:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: #eee;
    position: absolute;
    left: 10px; right: 10px; bottom: -12px;
}
.product-option-group-title {
    font-size: 1.13rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}
.product-option-group-desc {
    color: #888;
    font-size: 0.98rem;
    margin-bottom: 10px;
}
.product-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}
.product-btn-group .btn-check + .btn {
    border-radius: 12px;
    min-width: 110px;
    font-size: 1.08rem;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: #fff;
    transition: all 0.2s;
}
.product-btn-group .btn-check:checked + .btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.product-btn-group .btn-check:active + .btn,
.product-btn-group .btn-check:focus + .btn {
    box-shadow: 0 0 0 2px #FFD60055;
}
.product-btn-group .btn-outline-success {
    border-color: var(--success);
    color: var(--success);
}
.product-btn-group .btn-check:checked + .btn-outline-success {
    background: var(--success);
    color: #fff;
}

/* تحسين ملخص الخيارات */
#modal-options-summary {
    background: #f5f5f5;
    color: var(--secondary);
    border-radius: 8px;
    padding: 7px 12px;
    margin-bottom: 8px;
    font-size: 1.01rem;
    font-weight: 500;
    min-height: 28px;
    text-align: right;
}

/* تحسين المسافات في نافذة الكمية */
.product-qty-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-width: 220px;
    margin: 0 auto 18px auto;
}
.product-qty-row .btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.3rem;
    border-radius: 50%;
}
.product-qty-row input[type="number"] {
    max-width: 70px;
    font-size: 1.2rem;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid #eee;
    text-align: center;
    font-weight: bold;
}

/* تحسين السلة الجانبية */
.cart-sidebar .cart-item {
    background: #f9f9f9;
    border-radius: 12px;
    border: 1.5px solid #eee;
    padding: 12px 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(52,52,52,0.04);
}
.cart-sidebar .cart-item .cart-item-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}
.cart-sidebar .cart-item .cart-item-options {
    color: #888;
    font-size: 0.98rem;
    margin-bottom: 4px;
}
.cart-sidebar .cart-item .cart-item-qty {
    font-size: 1.01rem;
    color: var(--primary);
    font-weight: 600;
}

/* تحسين أزرار السلة */
.cart-sidebar .checkout-btn, .cart-sidebar .btn-outline-secondary {
    border-radius: 12px;
    min-height: 44px;
    font-size: 1.08rem;
    font-weight: 600;
}

/* تحسين Toast */
.toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 50% !important;
    left: auto !important;
    transform: translateX(50%) !important;
    z-index: 3000 !important;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 90vw;
}

.toast {
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast .toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.toast .toast-message {
    flex: 1;
    line-height: 1.4;
    font-weight: 500;
}

.toast .toast-close {
    position: relative;
    background: rgba(255,255,255,0.2);
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast .toast-close:hover { 
    opacity: 1; 
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.toast .toast-close:active {
    transform: scale(0.95);
}

/* Toast type specific styles */
.toast.success { 
    background: linear-gradient(135deg, var(--success), #66bb6a) !important;
    color: #fff !important;
    border-color: rgba(76,175,80,0.3) !important;
}

.toast.error { 
    background: linear-gradient(135deg, #dc3545, #ef5350) !important;
    color: #fff !important;
    border-color: rgba(220,53,69,0.3) !important;
}

.toast.warning { 
    background: linear-gradient(135deg, var(--warning), #ffb74d) !important;
    color: var(--secondary) !important;
    border-color: rgba(255,214,0,0.3) !important;
}

.toast.info { 
    background: linear-gradient(135deg, var(--primary), #ff8a65) !important;
    color: #fff !important;
    border-color: rgba(255,112,67,0.3) !important;
}

/* Mobile improvements for toast */
@media (max-width: 576px) {
    .toast-container {
        top: 16px !important;
        padding: 0 16px;
        max-width: 100vw;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 14px 16px;
        font-size: 0.95rem;
        border-radius: 14px;
    }
    
    .toast .toast-icon {
        font-size: 1.1rem;
        width: 20px;
    }
    
    .toast .toast-close {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Toast animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.toast.show {
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast:not(.show) {
    animation: toastSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 576px) {
    /* تحسينات أساسية للجوال */
    .product-option-group { 
        padding: 16px 12px 14px 12px; 
        margin-bottom: 18px; 
        border-radius: 16px;
    }
    .product-btn-group .btn-check + .btn { 
        min-width: 100px; 
        min-height: 48px;
        font-size: 1.02rem; 
        padding: 12px 16px;
        border-radius: 14px;
        margin-bottom: 8px;
    }
    .product-qty-row { 
        gap: 16px; 
        max-width: 200px; 
        margin: 16px auto 24px auto;
    }
    .product-qty-row .btn {
        min-width: 50px;
        min-height: 50px;
        font-size: 1.4rem;
    }
    .product-qty-row input[type="number"] {
        max-width: 80px;
        height: 50px;
        font-size: 1.3rem;
    }
    #modal-options-summary { 
        font-size: 1rem; 
        padding: 12px 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .cart-sidebar .cart-item { 
        padding: 16px 12px;
        margin-bottom: 16px;
        border-radius: 16px;
    }
}

/* شريط السلة السفلي */
.bottom-bar {
    background: var(--white);
    border-top: 1.5px solid #eee;
    padding: 14px 10px;
    /* position: fixed;
    left: 0; right: 0; bottom: 0; */
    z-index: 1000;
    box-shadow: 0 -2px 16px rgba(52,52,52,0.08);
    transition: box-shadow 0.2s, opacity 0.2s;
    display: none !important;
}

.cart-btn {
    background: var(--primary);
    color: var(--white);
    border-radius: 50px;
    font-size: 1.13rem;
    font-weight: 600;
    padding: 16px 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}

.cart-btn .cart-count {
    background: var(--secondary);
    color: var(--white);
    font-weight: bold;
    border-radius: 16px;
    padding: 4px 10px;
    margin-inline-start: 8px;
}

/* سلة المشتريات (Sidebar) */
.cart-sidebar {
    background: var(--white);
    border-left: none;
    position: fixed;
    top: 0; 
    right: -100%; 
    width: 100%; 
    height: 100%;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    overflow: hidden;
}

.cart-sidebar.show {
    right: 0;
}

/* Cart header */
.cart-header {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.cart-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.cart-header h5 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-header h5::before {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--white);
}

#close-cart-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

#close-cart-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

#close-cart-btn:active {
    transform: scale(0.95);
}

/* Cart items container */
.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #ff5722;
}

/* Empty cart state */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1rem;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 1 !important;
}

.empty-cart::before {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 16px;
    display: block;
}

.empty-cart::after {
    content: 'السلة فارغة';
    font-size: 1.2rem;
    font-weight: 600;
    color: #999;
    display: block;
}

/* Individual cart item */
.cart-item {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid #e9ecef;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--warning));
    border-radius: 16px 16px 0 0;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cart-item-details {
    margin-bottom: 16px;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.cart-item-options {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.cart-item-price {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    background: rgba(255,112,67,0.1);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

/* Cart item actions */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.quantity-control .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.quantity-control .btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.quantity-control .btn:active {
    transform: scale(0.95);
}

.quantity-control .quantity {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    min-width: 30px;
    text-align: center;
}

.cart-item-actions .edit-item,
.cart-item-actions .remove-item {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 2px solid;
    -webkit-tap-highlight-color: transparent;
}

.cart-item-actions .edit-item {
    border-color: var(--primary);
    background: var(--white);
    color: var(--primary);
}

.cart-item-actions .edit-item:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.cart-item-actions .remove-item {
    border-color: #dc3545;
    background: var(--white);
    color: #dc3545;
}

.cart-item-actions .remove-item:hover {
    background: #dc3545;
    color: var(--white);
    transform: scale(1.05);
}

.cart-item-actions .btn:active {
    transform: scale(0.95);
}

/* Cart total section */
.cart-total {
    background: var(--white);
    border-top: 1px solid #e9ecef;
    padding: 20px;
    position: relative;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.cart-total::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,112,67,0.3), transparent);
}

.cart-total .d-flex {
    margin-bottom: 20px;
}

.cart-total h5 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

#cart-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(255,112,67,0.1);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,112,67,0.2);
}

/* Action buttons */
.checkout-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #ff8a65);
    color: var(--white);
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(255,112,67,0.3);
    position: relative;
    overflow: hidden;
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,112,67,0.4);
}

.checkout-btn:hover::before {
    left: 100%;
}

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

#clear-cart-button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: var(--white);
    color: #666;
    border: 2px solid #e9ecef;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

#clear-cart-button:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: rgba(220,53,69,0.05);
    transform: translateY(-1px);
}

#clear-cart-button:active {
    transform: translateY(0);
}

/* Mobile specific improvements */
@media (max-width: 576px) {
    .cart-header {
        padding: 16px;
    }
    
    .cart-header h5 {
        font-size: 1.2rem;
    }
    
    .cart-items {
        padding: 16px;
    }
    
    .cart-item {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 14px;
    }
    
    .cart-item-name {
        font-size: 1rem;
    }
    
    .cart-item-options {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .cart-item-price {
        font-size: 0.95rem;
        padding: 4px 10px;
    }
    
    .quantity-control {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .quantity-control .btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .quantity-control .quantity {
        font-size: 1rem;
        min-width: 26px;
    }
    
    .cart-item-actions .edit-item,
    .cart-item-actions .remove-item {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .cart-total {
        padding: 16px;
    }
    
    .cart-total h5 {
        font-size: 1.1rem;
    }
    
    #cart-total {
        font-size: 1.2rem;
        padding: 6px 12px;
    }
    
    .checkout-btn {
        padding: 14px;
        font-size: 1rem;
        border-radius: 14px;
    }
    
    #clear-cart-button {
        padding: 12px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
}

/* Tablet improvements */
@media (min-width: 577px) and (max-width: 768px) {
    .cart-sidebar {
        width: 400px;
    }
    
    .cart-item {
        padding: 18px;
    }
    
    .quantity-control .btn {
        width: 40px;
        height: 40px;
    }
}

/* Desktop improvements */
@media (min-width: 769px) {
    .cart-sidebar {
        width: 450px;
    }
    
    .cart-item {
        padding: 24px;
    }
    
    .quantity-control .btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .cart-item-actions .edit-item,
    .cart-item-actions .remove-item {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* Loading states */
.cart-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-sidebar.show {
    animation: slideInRight 0.3s ease-out;
}

/* Item removal animation */
.cart-item.removing {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Better focus states */
.cart-item-actions .btn:focus,
.checkout-btn:focus,
#clear-cart-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255,112,67,0.1);
}

/* Improved accessibility */
@media (prefers-reduced-motion: reduce) {
    .cart-sidebar,
    .cart-item,
    .cart-item-actions .btn,
    .checkout-btn,
    #clear-cart-button {
        transition: none;
    }
    
    .cart-sidebar.show {
        animation: none;
    }
}

/* Welcome Modal */
.welcome-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(55, 71, 79, 0.10);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.welcome-modal.show {
    opacity: 1;
}

.welcome-content {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    border-radius: 18px;
    padding: 22px;
    box-shadow: none;
}

.welcome-header {
    text-align: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.welcome-logo {
    width: 70px; height: 70px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 2px solid var(--primary);
    background: var(--background);
}

.welcome-body {
    color: var(--secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.btn-close-welcome {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    margin-top: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-close-welcome:hover {
    background: var(--secondary);
}

.btn-show-welcome {
    position: fixed;
    bottom: 100px;
    left: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-show-welcome:hover {
    background: var(--secondary);
}

/* الفوتر أسفل الصفحة بعد شريط السلة */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 15px 0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    margin-top: auto;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* إخفاء شريط السلة السفلي نهائيًا */
.bottom-bar { display: none !important; }

/* التصميم الجديد للمنتجات بالتمرير الأفقي */
.category-section {
    margin-bottom: 36px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    border-radius: 18px;
    padding: 12px 8px 20px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
@media (max-width: 576px) {
    .category-section {
        padding: 10px 6px 16px 6px;
        border-radius: 14px;
    }
}
/* ضمان ألا يؤثر التعديل على التمرير الأفقي */
.category-section .products-horizontal-scroll {
    margin-top: 8px;
}

.category-header {
    padding: 0 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.see-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.see-all-link:hover {
    text-decoration: underline;
}

.products-horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 0 16px 0;
    margin-bottom: 0;
}

.products-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.products-row {
    display: flex;
    gap: 16px;
    padding: 0 8px;
}

.product-card-horizontal {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(52,52,52,0.07);
    border: 1.5px solid #f0f0f0;
    min-width: 210px;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.13s;
    position: relative;
    overflow: hidden;
}

.product-card-horizontal:hover {
    box-shadow: 0 6px 24px rgba(193,39,45,0.10);
    transform: translateY(-2px) scale(1.03);
}

.product-image-container {
    width: 100%;
    height: 140px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
    transition: transform 0.2s;
}

.product-card-horizontal:hover .product-image-container img {
    transform: scale(1.05);
}

.product-info {
    padding: 16px 14px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
    line-height: 1.3;
}

.product-desc {
    font-size: 0.92rem;
    color: #888;
    margin-bottom: 6px;
    line-height: 1.4;
    height: 2.2em;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.product-price {
    color: var(--primary);
    font-size: 1.08rem;
    font-weight: bold;
    background: #FFF3E0;
    border-radius: 8px;
    padding: 2px 12px;
    display: inline-block;
}

@media (max-width: 576px) {
    .category-title {
        font-size: 1.08rem;
        font-weight: 800;
    }
    .products-row {
        gap: 10px;
        padding: 0 4px;
    }
    .product-card-horizontal {
        min-width: 140px;
        max-width: 140px;
        border-radius: 12px;
    }
    .product-image-container {
        height: 80px;
        border-radius: 12px 12px 0 0;
    }
    .product-info {
        padding: 10px 8px 8px 8px;
        gap: 4px;
    }
    .product-name {
        font-size: 0.98rem;
        font-weight: 700;
    }
    .product-desc {
        font-size: 0.82rem;
        height: 2em;
    }
    .product-price {
        font-size: 0.98rem;
        padding: 2px 8px;
        border-radius: 7px;
    }
}

/* الأزرار العائمة الجديدة */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1200;
    padding: 0 20px;
}

.btn-support {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-support:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-cart-floating {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 25px;
    padding: 16px 24px;
    width: 100%;
    max-width: 350px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(193, 39, 45, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 600;
}

.btn-cart-floating:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(193, 39, 45, 0.4);
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-label {
    font-size: 1.05rem;
}

.cart-count-badge {
    background: var(--white);
    color: var(--primary);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.cart-total-floating {
    font-size: 1.1rem;
    font-weight: 700;
}

/* إخفاء زر السلة القديم */
.fab-cart {
    display: none !important;
}

/* تحسينات إضافية للتصميم الجديد */
.main-content {
    margin-top: 56px;
}

/* إضافة ظل للهيدر */
.top-nav {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* تحسين التمرير للمنتجات */
@media (hover: hover) {
    .products-horizontal-scroll {
        scrollbar-width: thin;
        scrollbar-color: var(--primary) #f0f0f0;
    }
    
    .products-horizontal-scroll::-webkit-scrollbar {
        display: block;
        height: 6px;
    }
    
    .products-horizontal-scroll::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }
    
    .products-horizontal-scroll::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }
}

/* تحسين الانتقالات */
.product-card-horizontal,
.btn-add-quick,
.btn-support,
.btn-cart-floating {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسين التفاعل مع اللمس */
@media (hover: none) {
    .product-card-horizontal:active {
        transform: scale(0.98);
    }
    
    .btn-add-quick:active {
        transform: scale(0.9);
    }
}

/* إضافة مؤشر التمرير */
.products-horizontal-scroll {
    position: relative;
}

.products-horizontal-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.products-horizontal-scroll:hover::after {
    opacity: 1;
}

/* تحسين عرض السعر */
.cart-count-badge:empty {
    display: none;
}

/* إضافة انيميشن للأزرار العائمة */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.floating-buttons {
    animation: slideUp 0.4s ease-out;
}

/* تحسين المودال للجوال */
@media (max-width: 576px) {
    #productModal .modal-dialog {
        max-height: 85vh;
    }
    
    #productModal .modal-content {
        max-height: 85vh;
    }
    
    .modal-handle {
        margin: 8px auto;
    }
}

.fab-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.fab-cart:hover::before {
    transform: translateX(100%);
}

.fab-cart:hover, .fab-cart:focus {
    background: linear-gradient(135deg, #ff8a65 0%, var(--primary) 100%);
    box-shadow: 0 12px 40px rgba(255,112,67,0.4);
    transform: scale(1.1) translateY(-2px);
}

.fab-cart:active {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 4px 20px rgba(255,112,67,0.3);
}

.fab-cart .cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    color: var(--primary);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 4px 8px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255,214,0,0.3);
    border: 2px solid var(--warning);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    transform: scale(0);
    opacity: 0;
}

.fab-cart .cart-badge.show {
    transform: scale(1);
    opacity: 1;
}

.fab-cart .cart-badge.bounce {
    animation: badge-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badge-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Pulse animation for empty cart */
.fab-cart.pulse {
    animation: fab-pulse 2s infinite;
}

@keyframes fab-pulse {
    0% { box-shadow: 0 8px 32px rgba(255,112,67,0.3); }
    50% { box-shadow: 0 8px 32px rgba(255,112,67,0.6); }
    100% { box-shadow: 0 8px 32px rgba(255,112,67,0.3); }
}

@media (max-width: 576px) {
    .fab-cart { 
        bottom: 90px; 
        right: 16px; 
        width: 60px; 
        height: 60px; 
        font-size: 2rem;
        box-shadow: 0 8px 32px rgba(255,112,67,0.35);
    }
    
    .fab-cart .cart-badge { 
        font-size: 1rem; 
        min-width: 22px; 
        min-height: 22px; 
        padding: 3px 7px;
        top: -1px;
        right: -1px;
    }
    
    .fab-cart:hover, .fab-cart:focus {
        transform: scale(1.05) translateY(-1px);
    }
}

/* Hide floating cart when modal is open */
body.modal-open .fab-cart {
    display: none !important;
}

/* Hide floating cart when cart sidebar is open */
.cart-sidebar.show ~ .fab-cart {
    display: none !important;
}

/* Responsive - تحسينات شاملة للجوال */
@media (max-width: 576px) {
    /* الهيدر والتنقل */
    .top-nav {
        height: 56px;
        padding: 0 16px;
    }

    .brand-name {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .categories-bar {
        margin-top: 56px;
        padding: 12px 8px;
    }

    .category-btn {
        font-size: 1.05rem;
        padding: 14px 20px 12px 20px;
        min-height: 48px;
        border-radius: 24px;
        margin: 0 4px;
    }

    /* بطاقات المنتجات */
    .product-list-item .bg-white {
        padding: 16px 12px;
        gap: 16px;
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .product-list-item img {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .product-title {
        font-size: 1.08rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .product-list-item .text-muted {
        font-size: 0.95rem;
        max-width: 200px;
    }

    .product-price {
        font-size: 1.05rem;
        padding: 6px 14px;
        border-radius: 10px;
    }

    .product-list-item .btn-outline-primary, 
    .product-list-item .btn-primary {
        min-width: 48px;
        min-height: 48px;
        font-size: 1.2rem;
        border-radius: 50%;
        margin-right: 0;
    }

    /* المودال والنوافذ */
    #productModal .modal-body { 
        padding: 20px 16px 0 16px !important; 
    }
    
    #productModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    #productModal .modal-content {
        height: 100%;
        border-radius: 20px 20px 0 0;
        border: none;
    }

    /* نافذة التأكيد */
    #confirmModal .modal-content { 
        border-radius: 20px;
        margin: 16px;
    }
    #confirmModal .modal-title { 
        font-size: 1.1rem; 
    }
    #confirmModal .modal-body { 
        font-size: 1.05rem; 
        padding: 20px 16px;
        line-height: 1.5;
    }
    #confirmModal .modal-footer { 
        padding: 16px;
        gap: 12px; 
    }
    #confirmModal .btn { 
        min-width: 100px; 
        min-height: 48px;
        font-size: 1.02rem;
        border-radius: 14px;
    }

    /* السلة */
    .cart-sidebar .cart-item .cart-item-actions {
        gap: 8px !important;
        margin-top: 12px;
    }
    
    .cart-sidebar .cart-item .cart-item-actions .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .cart-sidebar .cart-header {
        padding: 20px 16px;
        font-size: 1.1rem;
    }

    .cart-sidebar .cart-items {
        padding: 16px;
    }

    .cart-sidebar .cart-total {
        padding: 20px 16px;
    }

    .checkout-btn {
        min-height: 52px;
        font-size: 1.1rem;
        border-radius: 14px;
    }

    /* التوست */
    .toast-container {
        top: 24px !important;
        padding: 0 16px;
    }
    
    .toast {
        min-width: 200px;
        padding: 14px 20px;
        font-size: 1.02rem;
        border-radius: 16px;
    }

    /* الفوتر */
    .footer {
        padding: 16px 0;
        font-size: 0.95rem;
    }

    .welcome-content {
        padding: 24px 20px;
        margin: 16px;
        border-radius: 20px;
    }

    /* الشريط السفلي في المودال */
    .modal-floating-bar {
        padding: 20px 16px !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1) !important;
    }
    
    .modal-floating-bar .btn {
        min-height: 52px;
        font-size: 1.1rem;
        border-radius: 14px;
    }
    
    .modal-floating-bar .btn-primary {
        font-weight: 700;
    }

    /* تحسين المسافات العامة */
    .main-content { 
        padding-bottom: 120px; 
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* تحسين التمرير */
    .cart-items {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* تحسين اللمس والتفاعل */
    button, .btn, [role="button"], .clickable {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* تحسين الاستجابة للمس */
    .product-list-item, .category-btn, .fab-cart {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* تحسين التركيز للوصولية */
    button:focus, .btn:focus {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }
    
    /* إخفاء outline عند اللمس */
    button:focus:not(:focus-visible), 
    .btn:focus:not(:focus-visible) {
        outline: none;
    }
}

/* إخفاء زر السلة العائم عند فتح أي مودال */
body.modal-open .fab-cart {
    display: none !important;
}

/* نافذة تأكيد مخصصة */
#confirmModal .modal-content {
    border-radius: 18px;
    background: var(--white);
    border: 1.5px solid #eee;
    box-shadow: 0 2px 24px rgba(52,52,52,0.13);
    padding: 0;
}
#confirmModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
    background: none;
}
#confirmModal .modal-title {
    color: var(--primary);
    font-size: 1.18rem;
    font-weight: 700;
}
#confirmModal .modal-body {
    padding: 18px 10px 0 10px;
    font-size: 1.13rem;
    color: var(--secondary);
}
#confirmModal .modal-footer {
    border-top: none;
    padding: 18px 10px 18px 10px;
    background: none;
    gap: 18px;
}
#confirmModal .btn {
    min-width: 110px;
    min-height: 44px;
    font-size: 1.08rem;
    font-weight: 600;
    border-radius: 12px;
}
/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .product-list-item .bg-white {
        padding: 12px 8px;
        gap: 12px;
    }
    
    .product-list-item img {
        width: 56px;
        height: 56px;
    }

    .categories-bar {
        padding: 8px 4px;
    }

    .category-btn {
        padding: 12px 16px 10px 16px;
        font-size: 1rem;
    }
    }

/* تحسينات للشاشات العريضة الصغيرة */
@media (max-width: 768px) and (min-width: 577px) {
    .product-list-item .bg-white {
        padding: 20px 16px;
        gap: 20px;
    }

    .product-list-item img {
        width: 80px;
        height: 80px;
    }
    
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ===== Product Details Modal - HAAT Style ===== */

/* Modal handle */
.modal-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto;
}

/* Base modal improvements */
.modal-dialog-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: 100%;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog-bottom {
    transform: translateY(0);
}

#productModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: auto;
    max-height: 90vh;
}

#productModal .modal-content {
    border-radius: 20px 20px 0 0;
    border: none;
    background: var(--white);
    max-height: 90vh;
    overflow: hidden;
}

#productModal .modal-header {
    background: var(--white);
    border-bottom: 1px solid #eee;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#productModal .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

#productModal .btn-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#productModal .btn-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* Main content area */
#productModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Product image and basic info */
.product-modal-header {
    background: var(--white);
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.product-modal-image {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    border: 3px solid var(--white);
}

.product-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-modal-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Options container */
.product-modal-options {
    padding: 20px;
    background: var(--white);
}

/* Option groups */
.product-option-group {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.product-option-group-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
    text-align: center;
}

.product-option-group-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}

/* Option buttons */
.product-btn-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.product-btn-group .btn-check + .btn {
    border-radius: 16px;
    min-height: 56px;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    position: relative;
    overflow: hidden;
}

.product-btn-group .btn-check + .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.product-btn-group .btn-check + .btn:active::before {
    transform: translateX(100%);
}

.product-btn-group .btn-check:checked + .btn {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255,112,67,0.3);
}

.product-btn-group .btn-check:focus + .btn {
    box-shadow: 0 0 0 3px rgba(255,112,67,0.2);
}

/* Quantity section */
.product-modal-quantity {
    background: var(--white);
    padding: 24px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.quantity-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 16px;
    text-align: center;
}

.product-qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 240px;
    margin: 0 auto;
}

.product-qty-row .btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-qty-row .btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.product-qty-row .btn:active {
    transform: scale(0.95);
}

.product-qty-row input[type="number"] {
    width: 80px;
    height: 56px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    background: var(--white);
    transition: border-color 0.2s ease;
}

.product-qty-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,112,67,0.1);
}

/* Options summary */
#modal-options-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: var(--secondary);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 20px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid #e0e0e0;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Current item info (for editing) */
.current-item-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 16px;
    padding: 20px;
    margin: 20px;
    border: 1px solid #90caf9;
}

.current-item-info .info-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 12px;
    text-align: center;
}

.current-item-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #1565c0;
}

.current-item-info .info-item i {
    width: 20px;
    color: #1976d2;
}

/* Floating action bar */
.modal-floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1050;
    border-radius: 20px 20px 0 0;
}

.modal-floating-bar .btn {
    min-height: 56px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.modal-floating-bar .btn-outline-secondary {
    border: 2px solid #e0e0e0;
    color: #666;
    background: var(--white);
}

.modal-floating-bar .btn-outline-secondary:hover {
    border-color: #ccc;
    background: #f8f9fa;
}

.modal-floating-bar .btn-primary {
    background: linear-gradient(135deg, var(--primary), #ff8a65);
    border: none;
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(255,112,67,0.3);
}

.modal-floating-bar .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,112,67,0.4);
}

.modal-floating-bar .btn-primary:active {
    transform: translateY(0);
}

/* Price display */
#modal-final-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Mobile specific improvements */
@media (max-width: 576px) {
    #productModal .modal-header {
        padding: 12px 16px;
    }
    
    #productModal .modal-title {
        font-size: 1.1rem;
    }
    
    .product-modal-header {
        padding: 20px 16px;
    }
    
    .product-modal-image {
        width: 100px;
        height: 100px;
    }
    
    .product-modal-title {
        font-size: 1.3rem;
    }
    
    .product-modal-options {
        padding: 16px;
    }
    
    .product-option-group {
        padding: 20px 16px;
        margin-bottom: 20px;
    }
    
    .product-option-group-title {
        font-size: 1.1rem;
    }
    
    .product-btn-group {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .product-btn-group .btn-check + .btn {
        min-height: 52px;
        font-size: 1rem;
        padding: 14px 16px;
    }
    
    .product-modal-quantity {
        padding: 20px 16px;
    }
    
    .quantity-label {
        font-size: 1rem;
    }
    
    .product-qty-row {
        gap: 16px;
        max-width: 200px;
    }
    
    .product-qty-row .btn {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }
    
    #modal-options-summary {
        margin: 16px;
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .current-item-info {
        margin: 16px;
        padding: 16px;
    }
    
    .modal-floating-bar {
        padding: 16px;
    }
    
    .modal-floating-bar .btn {
        min-height: 52px;
        font-size: 1rem;
    }
}

/* Tablet improvements */
@media (min-width: 577px) and (max-width: 768px) {
    #productModal .modal-dialog {
        max-width: 90%;
        margin: 2rem auto;
        height: auto;
        max-height: 90vh;
    }
    
    #productModal .modal-content {
        height: auto;
        border-radius: 20px;
    }
    
    .modal-floating-bar {
        position: sticky;
        border-radius: 0 0 20px 20px;
    }
}

/* Desktop improvements */
@media (min-width: 769px) {
    #productModal .modal-dialog {
        max-width: 600px;
        margin: 2rem auto;
        height: auto;
        max-height: 90vh;
    }
    
    #productModal .modal-content {
        height: auto;
        border-radius: 24px;
    }
    
    .modal-floating-bar {
        position: sticky;
        border-radius: 0 0 24px 24px;
    }
    
    .product-btn-group {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .product-btn-group .btn-check + .btn {
        min-height: 60px;
        font-size: 1.1rem;
        padding: 18px 24px;
    }
}

/* Smooth animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#productModal.show .modal-content {
    animation: slideInUp 0.3s ease-out;
}

/* Loading states */
.product-btn-group .btn-check + .btn.loading {
    position: relative;
    color: transparent;
}

.product-btn-group .btn-check + .btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Additional Mobile UX Improvements ===== */

/* Better touch targets and feedback */
.product-btn-group .btn-check + .btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.product-btn-group .btn-check + .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Improved focus states for accessibility */
.product-btn-group .btn-check:focus + .btn {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Better quantity input styling */
.product-qty-row input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-qty-row input[type="number"]::-webkit-outer-spin-button,
.product-qty-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Smooth scrolling improvements */
#productModal .modal-body {
    scroll-padding-bottom: 120px;
    scroll-behavior: smooth;
}

/* Better modal backdrop */
#productModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Loading animation for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success animation for price changes */
@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--success); }
    100% { transform: scale(1); }
}

.price-updated {
    animation: priceUpdate 0.3s ease;
}

/* Better option group spacing on very small screens */
@media (max-width: 480px) {
    .product-option-group {
        padding: 16px 12px;
        margin-bottom: 16px;
    }
    
    .product-btn-group {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .product-btn-group .btn-check + .btn {
        min-height: 48px;
        font-size: 0.95rem;
        padding: 12px 14px;
    }
    
    .product-modal-header {
        padding: 16px 12px;
    }
    
    .product-modal-image {
        width: 80px;
        height: 80px;
    }
    
    .product-modal-title {
        font-size: 1.2rem;
    }
    
    .modal-floating-bar {
        padding: 12px;
    }
    
    .modal-floating-bar .btn {
        min-height: 48px;
        font-size: 0.95rem;
    }
}

/* Landscape orientation improvements */
@media (max-height: 500px) and (orientation: landscape) {
    #productModal .modal-dialog {
        max-height: 100vh;
    }
    
    .product-modal-header {
        padding: 12px 20px;
    }
    
    .product-modal-image {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }
    
    .product-modal-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .product-modal-description {
        font-size: 0.9rem;
    }
    
    .product-option-group {
        padding: 16px 20px;
        margin-bottom: 16px;
    }
    
    .product-modal-quantity {
        padding: 16px 20px;
    }
    
    .modal-floating-bar {
        padding: 12px 20px;
    }
}

/* High DPI display improvements */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-modal-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .product-btn-group .btn-check + .btn,
    .product-qty-row .btn,
    .modal-floating-bar .btn {
        transition: none;
    }
    
    #productModal.show .modal-content {
        animation: none;
    }
    
    .price-updated {
        animation: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}

/* Print styles */
@media print {
    #productModal {
        display: none !important;
    }
}

/* ===== Final Polish and Visual Improvements ===== */

/* Better visual hierarchy */
.product-modal-header {
    position: relative;
    overflow: hidden;
}

.product-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--warning));
    border-radius: 0 0 2px 2px;
}

/* Improved option group styling */
.product-option-group {
    position: relative;
    overflow: hidden;
}

.product-option-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,112,67,0.3), transparent);
}

/* Better button states */
.product-btn-group .btn-check + .btn {
    position: relative;
    overflow: hidden;
}

.product-btn-group .btn-check + .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.product-btn-group .btn-check + .btn:hover::after {
    left: 100%;
}

/* Improved quantity section */
.product-modal-quantity {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-modal-quantity::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,112,67,0.2), transparent);
}

/* Better floating bar */
.modal-floating-bar {
    position: relative;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.modal-floating-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,112,67,0.3), transparent);
}

/* Improved price display */
#modal-final-price {
    position: relative;
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255,112,67,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,112,67,0.2);
}

/* Better current item info */
.current-item-info {
    position: relative;
    overflow: hidden;
}

.current-item-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
}

/* Improved options summary */
#modal-options-summary {
    position: relative;
    overflow: hidden;
}

#modal-options-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(76,175,80,0.3), transparent);
}

/* Better focus states */
.product-btn-group .btn-check:focus + .btn,
.product-qty-row .btn:focus,
.modal-floating-bar .btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255,112,67,0.1);
}

/* Improved hover effects */
.product-btn-group .btn-check + .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-qty-row .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255,112,67,0.3);
}

/* Better loading states */
.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Improved animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-option-group {
    animation: fadeInUp 0.3s ease-out;
}

.product-option-group:nth-child(1) { animation-delay: 0.1s; }
.product-option-group:nth-child(2) { animation-delay: 0.2s; }
.product-option-group:nth-child(3) { animation-delay: 0.3s; }
.product-option-group:nth-child(4) { animation-delay: 0.4s; }

/* Better scrollbar styling */
#productModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#productModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#productModal .modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

#productModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #ff5722;
}

/* Improved accessibility */
@media (prefers-reduced-motion: no-preference) {
    .product-option-group {
        animation: fadeInUp 0.3s ease-out;
    }
}

/* Better contrast for better readability */
.product-modal-title {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-option-group-title {
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Improved touch feedback */
@media (hover: none) and (pointer: coarse) {
    .product-btn-group .btn-check + .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .product-qty-row .btn:active {
        transform: scale(0.9);
        transition: transform 0.1s ease;
    }
    
    .modal-floating-bar .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ===== Product Modal Multi-Step Styles ===== */

/* صفحات متعددة في نافذة التفاصيل */
.modal-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.modal-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* عداد الصفحات */
.step-counter {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* أزرار التنقل بين الصفحات */
.step-navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.step-navigation .btn-prev,
.step-navigation .btn-next {
    min-width: 120px;
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.step-navigation .btn-prev {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.step-navigation .btn-next {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
}

.step-navigation .btn-prev:hover {
    background: #fff5f5;
}

.step-navigation .btn-next:hover {
    background: var(--primary-dark);
}

/* زر أضف للسلة في الصفحة الأخيرة */
.btn-add-to-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 25px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 39, 45, 0.3);
}

/* تحسين تصميم الخيارات */
.option-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary);
    background: #fff5f5;
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    width: 24px;
    height: 24px;
    margin-left: 0;
    margin-right: 16px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.option-item input[type="radio"] {
    border-radius: 50%;
}

/* حالة التحديد */
.option-item input[type="checkbox"]:checked,
.option-item input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* علامة الصح للـ checkbox */
.option-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* النقطة للـ radio */
.option-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

/* تأثير التركيز */
.option-item input[type="checkbox"]:focus,
.option-item input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.2);
}

.option-item label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.option-item .option-name {
    font-weight: 500;
}

.option-item .option-price {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
}

/* تحديث ألوان الأزرار */
.btn-primary, .checkout-btn, .fab-cart {
    background: var(--primary) !important;
    color: var(--text-light) !important;
    border-radius: 12px;
    border: none;
}

.btn-primary:hover, .btn-primary:focus, .checkout-btn:hover, .fab-cart:hover {
    background: var(--primary-dark) !important;
}

/* تحديث السعر في زر الإضافة */
.modal-floating-bar .btn-primary #modal-final-price {
    color: #fff !important;
    background: rgba(0,0,0,0.15) !important;
    font-weight: 700;
    font-size: 1.15rem;
    margin-inline-start: 8px;
    padding: 4px 12px;
    border-radius: 20px;
}

/* تحسينات إضافية لنافذة التفاصيل متعددة الصفحات */

/* تحسين تصميم المودال */
#productModal .modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    position: relative;
}

/* منع التمرير عندما تكون الصفحات متعددة */
.product-modal-options {
    padding: 0;
    background: var(--white);
}

/* تحسين عداد الصفحات */
.step-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    background: #fff5f5;
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid var(--primary);
    z-index: 10;
}

/* تحسين قائمة الخيارات */
.options-list {
    padding: 20px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

/* تحسين تصميم عناصر الخيارات */
.option-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.option-item:hover {
    border-color: var(--primary);
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    width: 24px;
    height: 24px;
    margin-left: 0;
    margin-right: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.option-item label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

.option-item .option-name {
    font-weight: 500;
    flex: 1;
}

.option-item .option-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    background: #fff5f5;
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 8px;
}

/* حالة العنصر المختار */
.option-item:has(input:checked) {
    background: #fff5f5;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.1);
}

.option-item:has(input:checked) .option-name {
    color: var(--primary);
    font-weight: 600;
}

/* تحسين شريط التنقل */
.step-navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-top: 2px solid var(--border);
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

/* تحسين أزرار التنقل */
.step-navigation .btn-prev,
.step-navigation .btn-next,
.btn-add-to-cart {
    min-width: 140px;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step-navigation .btn-prev {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.step-navigation .btn-prev:hover {
    background: #fff5f5;
    transform: translateX(4px);
}

.step-navigation .btn-next {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
}

.step-navigation .btn-next:hover {
    background: var(--primary-dark);
    transform: translateX(-4px);
}

/* زر أضف للسلة محسن */
.btn-add-to-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 25px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 200px;
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(193, 39, 45, 0.3);
}

.btn-add-to-cart #modal-final-price {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    margin-right: 8px;
    font-weight: 700;
}

/* انتقالات سلسة بين الصفحات */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-step {
    animation: slideInFromRight 0.3s ease;
}

.modal-step.from-prev {
    animation: slideInFromLeft 0.3s ease;
}

/* تحسينات للهواتف */
@media (max-width: 576px) {
    .step-counter {
        font-size: 0.9rem;
        padding: 4px 16px;
        top: 12px;
    }
    
    .options-list {
        padding: 16px;
        max-height: calc(100vh - 350px);
    }
    
    .option-item {
        padding: 14px 16px;
        margin-bottom: 10px;
    }
    
    .option-item .option-name {
        font-size: 1rem;
    }
    
    .option-item .option-price {
        font-size: 0.95rem;
        padding: 3px 10px;
    }
    
    .step-navigation {
        padding: 16px;
        gap: 12px;
    }
    
    .step-navigation .btn-prev,
    .step-navigation .btn-next,
    .btn-add-to-cart {
        min-width: 120px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* تحسين تصميم عناصر الخيارات مع الصور */
.option-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.option-item.has-image {
    padding: 12px 16px;
}

.option-item:hover {
    border-color: var(--primary);
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    width: 24px;
    height: 24px;
    margin-left: 0;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.option-item input[type="radio"] {
    border-radius: 50%;
}

/* حالة التحديد */
.option-item input[type="checkbox"]:checked,
.option-item input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* علامة الصح للـ checkbox */
.option-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* النقطة للـ radio */
.option-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

/* تأثير التركيز */
.option-item input[type="checkbox"]:focus,
.option-item input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.2);
}

.option-item label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    gap: 12px;
}

/* صور الخيارات */
.option-item .option-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #eee;
    flex-shrink: 0;
    margin-left: 12px;
}

.option-item .option-name {
    font-weight: 500;
    flex: 1;
}

.option-item .option-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    background: #fff5f5;
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 8px;
    white-space: nowrap;
}

/* حالة العنصر المختار */
.option-item:has(input:checked) {
    background: #fff5f5;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.1);
}

.option-item:has(input:checked) .option-name {
    color: var(--primary);
    font-weight: 600;
}

/* تحسين رسالة السلة الفارغة */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-cart::before {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-cart::after {
    content: 'السلة فارغة';
    font-size: 1.2rem;
    font-weight: 600;
    color: #999;
}

/* إصلاح مشكلة عرض رسالة السلة الفارغة */
.cart-items .empty-cart {
    display: flex !important;
}

/* تحسينات للجوال */
@media (max-width: 576px) {
    .option-item {
        padding: 10px;
        margin-bottom: 10px;
        min-height: 56px;
    }
    
    .option-item.has-image {
        padding: 6px 10px;
    }
    
    .option-item .option-image {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    
    .option-item .option-name {
        font-size: 1rem;
    }
    
    .option-item .option-price {
        font-size: 0.95rem;
        padding: 3px 10px;
    }
    
    .option-item input[type="checkbox"],
    .option-item input[type="radio"] {
        width: 22px;
        height: 22px;
        margin-right: 10px;
    }
}

/* تحسينات إضافية لنافذة التفاصيل */

/* تحسين هيدر المودال */
.product-modal-header {
    background: var(--white);
    padding: 20px;
    text-align: center;
    border-bottom: none;
    position: relative;
}

.product-modal-image {
    width: 150px;
    height: 150px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    border: 4px solid var(--white);
}

.product-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* تحسين مجموعات الخيارات */
.product-option-group {
    background: transparent;
    border: none;
    padding: 16px 20px;
    margin-bottom: 0;
}

.product-option-group-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    text-align: right;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* تحسين قائمة الخيارات */
.options-list {
    padding: 0;
    max-height: none;
    overflow-y: visible;
}

/* تحسين عداد الصفحات */
.step-counter {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--background);
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    z-index: 10;
}

/* تحسين أزرار التنقل */
.step-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--white);
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.step-navigation .btn-prev,
.step-navigation .btn-next {
    min-width: 120px;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step-navigation .btn-prev {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid #ddd;
}

.step-navigation .btn-prev:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.step-navigation .btn-next {
    background: var(--primary);
    color: var(--white);
    border: none;
}

.step-navigation .btn-next:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(193, 39, 45, 0.2);
}

/* زر أضف للسلة محسن */
.btn-add-to-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 25px;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(193, 39, 45, 0.3);
}

.btn-add-to-cart #modal-final-price {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    margin-right: 8px;
    font-weight: 700;
}

/* تحسين صفحة الكمية */
.product-modal-quantity {
    background: var(--white);
    padding: 24px 20px;
    border-bottom: none;
}

.quantity-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.product-qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 200px;
    margin: 0 auto;
}

.product-qty-row .btn {
        width: 48px;
        height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid #ddd;
    background: var(--white);
    color: var(--text-dark);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-qty-row .btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: scale(1.05);
}

.product-qty-row .btn:active {
    transform: scale(0.95);
}

.product-qty-row input[type="number"] {
    width: 70px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #ddd;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.2s ease;
}

/* تحسين ملخص الخيارات */
#modal-options-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 20px;
    font-size: 0.95rem;
}

/* تحسينات للجوال */
@media (max-width: 576px) {
    .product-modal-header {
        padding: 16px;
    }
    
    .product-modal-image {
        width: 120px;
        height: 120px;
        border-radius: 20px;
    }
    
    .product-modal-title {
        font-size: 1.3rem;
    }
    
    .product-option-group {
        padding: 12px 16px;
    }
    
    .product-option-group-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .step-navigation {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .step-navigation .btn-prev,
    .step-navigation .btn-next,
    .btn-add-to-cart {
        min-width: 110px;
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .product-modal-quantity {
        padding: 20px 16px;
    }
    
    .product-qty-row {
        gap: 16px;
    }
    
    .product-qty-row .btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .product-qty-row input[type="number"] {
        width: 60px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* تحسينات عامة للجوال */
@media (max-width: 576px) {
    /* تحسين الهيدر */
    .top-nav {
        height: 56px;
        padding: 0 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    /* تحسين شريط التصنيفات */
    .categories-bar {
        padding: 8px 4px;
        gap: 4px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .categories-bar::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        font-size: 0.95rem;
        padding: 10px 16px 8px 16px;
        min-height: 42px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* تحسين بطاقات المنتجات */
    .product-list-item {
        margin-bottom: 8px;
    }
    
    .product-list-item .bg-white {
        padding: 12px 10px;
        gap: 12px;
        margin-bottom: 8px;
        border-radius: 12px;
        min-height: 80px;
    }
    
    .product-list-item img {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    .product-title {
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    .product-list-item .text-muted {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .product-price {
        font-size: 1rem;
        padding: 4px 10px;
        border-radius: 8px;
    }
    
    .product-list-item .btn {
        min-width: 42px;
        min-height: 42px;
        font-size: 1.1rem;
        padding: 0;
    }
    
    /* تحسين المودال */
    #productModal .modal-dialog {
        margin: 0;
        min-height: 100vh;
    }
    
    #productModal .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }
    
    #productModal .modal-body {
        padding: 0;
        padding-bottom: 80px;
    }
    
    /* تحسين السلة الجانبية */
    .cart-sidebar {
        width: 100%;
    }
    
    .cart-header {
        padding: 16px;
        height: 60px;
    }
    
    .cart-header h5 {
        font-size: 1.1rem;
    }
    
    .cart-items {
        padding: 12px;
    }

    .cart-item {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .cart-item-name {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .cart-item-options {
        font-size: 0.85rem;
        padding: 4px 8px;
        margin-bottom: 6px;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
        padding: 3px 8px;
    }
    
    .cart-item-actions {
        gap: 6px;
        margin-top: 8px;
    }
    
    .quantity-control {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .quantity-control .btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .quantity-control .quantity {
        font-size: 0.95rem;
        min-width: 24px;
    }
    
    .cart-item-actions .edit-item,
    .cart-item-actions .remove-item {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .cart-total {
        padding: 16px;
    }
    
    .cart-total h5 {
        font-size: 1.05rem;
    }
    
    #cart-total {
        font-size: 1.1rem;
        padding: 4px 10px;
    }
    
    .checkout-btn {
        padding: 12px;
        font-size: 1rem;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    #clear-cart-button {
        padding: 10px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    /* تحسين الأزرار العائمة للجوال */
    .floating-buttons {
        padding: 0 16px;
        bottom: 16px;
    }
    
    .btn-support {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .btn-cart-floating {
        padding: 14px 20px;
        max-width: 100%;
    }
    
    .cart-label {
        font-size: 1rem;
    }
    
    .cart-total-floating {
        font-size: 1.05rem;
    }
    
    /* تحسين البطاقات الأفقية للجوال */
    .product-card-horizontal {
        min-width: 240px;
        max-width: 240px;
    }
    
    .product-image-container {
        height: 140px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-desc {
        font-size: 0.8rem;
        height: 2.4em;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .btn-add-quick {
        width: 32px;
        height: 32px;
    }
    
    /* تحسين التوست */
    .toast-container {
        top: 70px !important;
        padding: 0 12px;
    }
    
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 24px);
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 12px;
    }
    
    .toast .toast-icon {
        font-size: 1rem;
        width: 18px;
    }
    
    .toast .toast-close {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    /* تحسين الفوتر */
    .footer {
        padding: 12px 0;
        font-size: 0.85rem;
    }
    
    /* تحسين المسافات العامة */
    .main-content {
        padding-bottom: 140px;
    }
    
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* تحسين رسالة الترحيب */
    .welcome-content {
        padding: 20px 16px;
        margin: 12px;
        border-radius: 16px;
        max-width: calc(100vw - 24px);
    }
    
    .welcome-header h2 {
        font-size: 1.2rem;
    }
    
    .welcome-body {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .welcome-body ul {
        padding-right: 20px;
    }
    
    .btn-close-welcome {
        padding: 10px;
        font-size: 0.95rem;
        margin-top: 12px;
    }
    
    .btn-show-welcome {
        bottom: 130px;
        left: 12px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 400px) {
    .product-list-item img {
        width: 56px;
        height: 56px;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 0.95rem;
        padding: 3px 8px;
    }
    
    .fab-cart {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }
}

/* تحسينات للأداء */
@media (hover: none) and (pointer: coarse) {
    /* تحسين اللمس للأجهزة المحمولة */
    button, .btn, [role="button"], .clickable {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* إزالة تأثيرات hover غير الضرورية */
    .product-list-item .bg-white:hover {
        border-color: #eee;
        box-shadow: none;
    }
    
    .option-item:hover {
        border-color: var(--border);
        background: var(--white);
        transform: none;
        box-shadow: none;
    }
}

/* تحسين الأداء العام */
* {
    -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
    font-size: 16px; /* منع التكبير التلقائي في iOS */
}

/* تحسين التمرير */
.cart-items,
.options-list,
#productModal .modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* إصلاح مشكلة ارتفاع المودال في الجوال */
@supports (height: 100dvh) {
    @media (max-width: 576px) {
        #productModal .modal-dialog,
        #productModal .modal-content {
            min-height: 100dvh;
        }
    }
}

/* تحسين الانتقالات للأداء */
@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

.floating-buttons.hide {
    display: none !important;
} 

/* ===== تحسين Bottom Sheet/Modal لتجربة هات ===== */
.product-modal-sheet {
    border-radius: 28px 28px 0 0;
    background: #fff;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.13);
    padding: 0;
    overflow: hidden;
    max-width: 100vw;
    min-height: 60vh;
}
.product-modal-sheet .product-modal-image {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    object-fit: cover;
    margin: 24px auto 12px auto;
    display: block;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.product-modal-sheet .product-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
}
.product-modal-sheet .product-modal-description {
    font-size: 1.05rem;
    color: #666;
    text-align: center;
    margin-bottom: 18px;
}
.product-modal-sheet .qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}
.product-modal-sheet .qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.product-modal-sheet .qty-btn:active {
    transform: scale(0.95);
}
.product-modal-sheet .qty-input {
    width: 60px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #eee;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--white);
}
.product-modal-sheet .step-counter {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    background: #fff5f5;
    padding: 8px 24px;
    border-radius: 20px;
    margin: 0 auto 18px auto;
    display: block;
    text-align: center;
}
.product-modal-sheet .option-group-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
    text-align: right;
}
.product-modal-sheet .option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f9f9f9;
    border-radius: 14px;
    padding: 14px 12px;
    margin-bottom: 12px;
    border: 1.5px solid #eee;
    transition: border-color 0.2s;
}
.product-modal-sheet .option-item.selected {
    border-color: var(--primary);
    background: #fff5f5;
}
.product-modal-sheet .option-image {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #eee;
}
.product-modal-sheet .option-name {
    font-weight: 600;
    flex: 1;
    font-size: 1.05rem;
}
.product-modal-sheet .option-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    background: #fff5f5;
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 8px;
    white-space: nowrap;
}
.product-modal-sheet .option-checkbox {
    width: 28px;
    height: 28px;
    accent-color: var(--primary);
    border-radius: 8px;
}
.product-modal-sheet .step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px 24px 20px;
    background: #fff;
    border-top: 1.5px solid #eee;
    border-radius: 0 0 28px 28px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.product-modal-sheet .btn-nav {
    min-width: 120px;
    padding: 14px 24px;
    border-radius: 25px;
    font-size: 1.08rem;
    font-weight: 700;
    transition: all 0.2s;
}
.product-modal-sheet .btn-nav.primary {
    background: var(--primary);
    color: #fff;
    border: none;
}
.product-modal-sheet .btn-nav.secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}
.product-modal-sheet .btn-nav:active {
    transform: scale(0.97);
}
.product-modal-sheet .options-summary {
    background: #f5f5f5;
    color: var(--secondary);
    border-radius: 12px;
    padding: 10px 16px;
    margin: 18px 0 0 0;
    font-size: 1.01rem;
    font-weight: 500;
    min-height: 28px;
    text-align: right;
}
@media (max-width: 576px) {
    .product-modal-sheet {
        border-radius: 18px 18px 0 0;
        min-height: 70vh;
    }
    .product-modal-sheet .product-modal-image {
        width: 120px;
        height: 120px;
        border-radius: 16px;
        margin: 16px auto 8px auto;
    }
    .product-modal-sheet .qty-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .product-modal-sheet .qty-input {
        width: 44px;
        height: 40px;
        font-size: 1rem;
    }
    .product-modal-sheet .step-counter {
        font-size: 1rem;
        padding: 6px 16px;
    }
    .product-modal-sheet .option-item {
        padding: 10px 8px;
        gap: 8px;
    }
    .product-modal-sheet .option-image {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    .product-modal-sheet .btn-nav {
        min-width: 90px;
        padding: 10px 12px;
        font-size: 0.98rem;
    }
}
/* ===== نهاية تحسين Bottom Sheet/Modal ===== */

/* ===== الزر العائم الجديد (طلبك) وزر الدعم ===== */
.floating-cart-bar {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1200;
    pointer-events: none;
}
.btn-cart-bar {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 16px 28px 16px 18px;
    font-size: 1.13rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 24px rgba(193,39,45,0.18);
    min-width: 260px;
    max-width: 400px;
    width: 100%;
    pointer-events: auto;
    transition: all 0.2s;
}
.btn-cart-bar:active {
    transform: scale(0.97);
}
.cart-bar-icon {
    font-size: 1.4rem;
    margin-left: 6px;
}
.cart-bar-label {
    font-size: 1.08rem;
    font-weight: 700;
    margin-left: 8px;
}
.cart-bar-count {
    background: #fff;
    color: var(--primary);
    border-radius: 50%;
    min-width: 28px;
    min-height: 28px;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cart-bar-total {
    margin-right: auto;
    font-size: 1.13rem;
    font-weight: 700;
    background: #fff5f5;
    color: var(--primary);
    border-radius: 12px;
    padding: 4px 14px;
    margin-left: 8px;
}
.btn-support-floating {
    position: absolute;
    left: 18px;
    bottom: 54px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    pointer-events: auto;
    transition: all 0.2s;
    z-index: 2;
}
.btn-support-floating:active {
    transform: scale(0.95);
}
@media (max-width: 576px) {
    .floating-cart-bar {
        bottom: 8px;
    }
    .btn-cart-bar {
        min-width: 90vw;
        max-width: 98vw;
        padding: 14px 10px 14px 10px;
        font-size: 1.01rem;
    }
    .btn-support-floating {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        left: 10px;
        bottom: 46px;
    }
    .cart-bar-count {
        min-width: 22px;
        min-height: 22px;
        font-size: 0.95rem;
    }
    .cart-bar-total {
        font-size: 1rem;
        padding: 3px 8px;
    }
}
/* إخفاء الأزرار العائمة القديمة */
.fab-cart, .floating-buttons { display: none !important; }
/* ===== نهاية الزر العائم الجديد ===== */

/* ===== تحسينات واجهة المنتج المدمجة ===== */
#productModal .btn-close {
    position: absolute;
    top: 16px;
    left: 16px; /* In LTR, use left. For RTL, this should be right */
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 1;
}

.product-modal-header-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.product-modal-header-compact .product-modal-image {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    object-fit: cover;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.product-modal-header-compact .product-modal-info-col {
    flex: 1;
    min-width: 0; /* Prevents flexbox overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.product-modal-header-compact .product-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-align: right;
    color: var(--primary);
}

.product-modal-header-compact .product-qty-row {
    margin: 0;
    width: 100%;
    justify-content: flex-start;
}

.product-modal-header-compact .product-qty-row .btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.product-modal-header-compact .product-qty-row input[type="number"] {
    width: 45px;
    height: 36px;
    font-size: 1.1rem;
}

.product-modal-options {
    padding: 0 16px 16px 16px;
}

.product-modal-sheet .product-option-group-title {
    padding-top: 16px;
    font-size: 1.25rem;
    color: var(--secondary);
    border-bottom: none;
    margin-bottom: 12px;
}

.product-modal-sheet .current-item-info {
    font-size: 0.9rem;
    background: #f0f5ff;
    border: 1px solid #d9e2ff;
    padding: 8px 12px;
    margin: 12px;
    border-radius: 12px;
}

/* Make sure step navigation buttons are full width if only one is visible */
.step-navigation {
    padding: 12px 16px;
}

.step-navigation .btn-add-to-cart,
.step-navigation .btn-next {
    flex: 1;
}

.btn-add-to-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-add-to-cart span:first-of-type {
    margin: 0 auto;
}

/* Hide original header and quantity sections to avoid conflicts */
.product-modal-header, .product-modal-quantity {
    display: none;
}