* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --success-color: #10b981;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.header-content p {
    font-size: 14px;
    opacity: 0.9;
}

/* Header Left Section */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-brand-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

.products-section h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    background: var(--bg-light);
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    display: block;
}

.product-image:hover {
    transform: scale(1.05);
    filter: brightness(0.95);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.product-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-view {
    flex: 1;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #4f46e5;
}

.btn-quick-add {
    padding: 10px 15px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-quick-add:hover {
    background: #059669;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 90vw;
}

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

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

.cart-header h2 {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.cart-item-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid var(--border-color);
    background: var(--bg-light);
}

#cartFooterDetails {
    margin-bottom: 12px;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.cart-shipping {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #e67e22;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.cart-total-line {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.checkout-btn:hover {
    transform: scale(1.02);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#modalMainImage {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-light);
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.modal-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.modal-thumbnail:hover,
.modal-thumbnail.active {
    border-color: var(--primary-color);
}

.modal-info h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.modal-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: fit-content;
}

.quantity-selector button {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    color: var(--primary-color);
    transition: background 0.3s;
}

.quantity-selector button:hover {
    background: var(--bg-light);
}

.quantity-selector input {
    width: 60px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.quantity-selector input:focus {
    outline: none;
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background: #059669;
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .product-image {
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    #modalMainImage {
        height: 300px;
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .header-content h1 {
        font-size: 20px;
    }

    .header-brand-name {
        font-size: 18px;
    }

    .header-left {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-image {
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-info {
        padding: 15px;
    }

    .product-name {
        font-size: 16px;
    }

    .product-description {
        font-size: 12px;
    }

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

    .product-actions {
        gap: 8px;
    }

    .btn-view,
    .btn-quick-add {
        font-size: 13px;
        padding: 8px;
    }

    .header-content h1 {
        font-size: 18px;
    }

    .header-content p {
        font-size: 12px;
    }

    .modal-content {
        width: 98%;
        border-radius: 8px;
    }

    .modal-body {
        padding: 15px;
        gap: 15px;
    }

    #modalMainImage {
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .modal-info h2 {
        font-size: 20px;
    }

    .modal-price {
        font-size: 24px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

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

.site-footer {
    background-color: #2d3748;
    color: #e2e8f0;
    margin-top: 60px;
    direction: rtl;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 30px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* القسم الأيمن: بطاقة التواصل */
.footer-contact-card {
    background: #3a4556;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer-subtitle {
    font-size: 15px;
    color: #a0aec0;
    margin-bottom: 18px;
}

.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    direction: ltr;
    justify-content: flex-end;
}

.footer-contact-link:hover {
    color: #ffffff;
}

.footer-contact-link svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* القسم الأوسط: تابعنا */
.footer-social-section {
    text-align: center;
    padding-top: 10px;
}

.footer-social-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
}

.footer-social-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

/* القسم الأيسر: من نحن */
.footer-about-section {
    padding-top: 10px;
}

.footer-about-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
}

.footer-about-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
    display: inline-block;
}

.footer-about-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* شريط حقوق النشر */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 20px;
    margin-top: 0;
}

.footer-bottom p {
    font-size: 14px;
    color: #a0aec0;
    margin: 0;
}

.footer-bottom strong {
    color: #ffffff;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-contact-card {
        max-width: 350px;
        margin: 0 auto;
    }

    .footer-contact-link {
        justify-content: center;
    }

    .footer-social-icons {
        justify-content: center;
    }

    .footer-about-section {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-container {
        padding: 30px 15px 20px;
    }

    .footer-brand {
        font-size: 22px;
    }

    .footer-contact-card {
        padding: 20px;
    }

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

    .footer-social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* ========================================
   About Us Modal Styles
   ======================================== */

.about-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 5000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.about-modal-overlay.active {
    display: flex;
}

.about-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    padding: 40px;
    position: relative;
    text-align: center;
    direction: rtl;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: aboutModalIn 0.4s ease;
}

@keyframes aboutModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.about-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.about-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.about-modal-header {
    margin-bottom: 25px;
}

.about-modal-title {
    font-size: 32px;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.about-modal-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    margin: 0 auto 12px;
    border-radius: 2px;
}

.about-modal-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
}

.about-modal-body {
    margin-bottom: 30px;
}

.about-modal-body p {
    font-size: 17px;
    line-height: 1.9;
    color: #4b5563;
    text-align: center;
}

.about-modal-footer {
    display: flex;
    justify-content: center;
}

.about-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.about-contact-btn:hover {
    background: #1fb855;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.about-contact-btn svg {
    flex-shrink: 0;
}

/* About Modal Responsive */
@media (max-width: 480px) {
    .about-modal {
        padding: 30px 20px;
        width: 95%;
    }

    .about-modal-title {
        font-size: 26px;
    }

    .about-modal-subtitle {
        font-size: 18px;
    }

    .about-modal-body p {
        font-size: 15px;
    }

    .about-contact-btn {
        padding: 10px 22px;
        font-size: 14px;
    }
}

/* ===== WhatsApp Floating Button ===== */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    direction: rtl;
    animation: whatsapp-bounce 2s ease-in-out infinite;
}

.whatsapp-float-btn {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.whatsapp-float:hover .whatsapp-float-btn {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float-text {
    background: white;
    color: #374151;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    position: relative;
}

.whatsapp-float-text::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

@keyframes whatsapp-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        left: 15px;
    }
    .whatsapp-float-btn {
        width: 52px;
        height: 52px;
    }
    .whatsapp-float-btn svg {
        width: 24px;
        height: 24px;
    }
    .whatsapp-float-text {
        font-size: 12px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 12px;
        left: 12px;
    }
    .whatsapp-float-text {
        font-size: 11px;
        padding: 6px 10px;
    }
    .whatsapp-float-btn {
        width: 46px;
        height: 46px;
    }
    .whatsapp-float-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* ===== YouTube Floating Button ===== */
.youtube-float {
    position: fixed;
    bottom: 100px;
    left: 25px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    direction: rtl;
    text-decoration: none;
    animation: youtube-bounce 2.5s ease-in-out infinite;
}

.youtube-float-btn {
    width: 60px;
    height: 60px;
    background: #FF0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.youtube-float:hover .youtube-float-btn {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

.youtube-float-text {
    background: white;
    color: #374151;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    position: relative;
}

.youtube-float-text::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

@keyframes youtube-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Responsive YouTube */
@media (max-width: 768px) {
    .youtube-float {
        bottom: 82px;
        left: 15px;
    }
    .youtube-float-btn {
        width: 52px;
        height: 52px;
    }
    .youtube-float-btn svg {
        width: 24px;
        height: 24px;
    }
    .youtube-float-text {
        font-size: 12px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .youtube-float {
        bottom: 72px;
        left: 12px;
    }
    .youtube-float-text {
        font-size: 11px;
        padding: 6px 10px;
    }
    .youtube-float-btn {
        width: 46px;
        height: 46px;
    }
    .youtube-float-btn svg {
        width: 22px;
        height: 22px;
    }
}


/* ============================================ */
/* تنسيقات رموز الألوان والسلة المحسّنة */
/* ============================================ */

/* Thumbnail Wrapper مع رمز اللون */
.thumbnail-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
    min-width: 80px;
}

.thumbnail-wrapper:hover,
.thumbnail-wrapper.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.thumbnail-wrapper .modal-thumbnail {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: none;
    border-radius: 0;
}

.color-code-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(99, 102, 241, 0.85);
    color: white;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 0;
    letter-spacing: 1px;
}

/* عرض رمز اللون المختار */
.selected-color-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 14px;
    background: #f0f0ff;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.selected-color-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}

.selected-color-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

/* رمز اللون في السلة الجانبية */
.cart-item-color {
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-weight: 600;
}

/* أزرار الكمية في السلة */
.cart-qty-btn {
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-qty-btn:hover {
    background: #e5e7eb;
}

/* ============================================ */
/* قسم المنتجات المضافة للسلة في المودال */
/* ============================================ */

.modal-cart-items {
    margin-top: 20px;
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 15px;
    background: #fffbeb;
}

.modal-cart-header {
    background: #fde047;
    color: #1f2937;
    font-weight: 800;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.modal-cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-cart-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.modal-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.modal-cart-item-qty .qty-btn {
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-cart-item-qty .qty-btn:hover {
    background: #e5e7eb;
}

.modal-cart-item-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.modal-cart-color-code {
    font-size: 13px;
    color: var(--text-light);
}

.modal-cart-color-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

.modal-cart-item-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-cart-item-remove:hover {
    background: #fca5a5;
}

/* Responsive - رموز الألوان */
@media (max-width: 768px) {
    .thumbnail-wrapper .modal-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .color-code-badge {
        font-size: 10px;
    }
    
    .selected-color-value {
        font-size: 16px;
    }
    
    .modal-cart-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modal-cart-item-img {
        width: 40px;
        height: 40px;
    }
}


/* ============================================ */
/* Carousel Styles للصور الدوارة */
/* ============================================ */

.modal-thumbnails-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 0 45px;  /* مساحة للأسهم */
    /* على الحاسوب: عرض 4 صور */
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;  /* منع الصور من الظهور خلف الأسهم */
}

.carousel-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.carousel-btn.prev {
    left: 0;
}

.carousel-btn.next {
    right: 0;
}

.carousel-btn:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

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

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    padding: 0 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    /* عرض 4 صور على الحاسوب */
    width: auto;
    max-width: 100%;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* الوصف في قسم منفصل */
.modal-description-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.modal-description-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
}

/* ============================================ */
/* تحسينات Responsive للمودال على الهاتف */
/* ============================================ */

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 16px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-gallery {
        width: 100%;
        margin: 0;
    }

    #modalMainImage {
        height: 280px;
        width: 100%;
        object-fit: contain;
        background: #f9f9f9;
        border-radius: 8px;
    }

    .modal-thumbnails-carousel {
        margin: 10px 0;
        padding: 0 40px;
        gap: 6px;
        /* على الهاتف: عرض 3 صور */
        max-width: 100%;
    }
    
    .modal-thumbnails {
        /* عرض 3 صور على الهاتف */
        width: auto !important;
        max-width: 100% !important;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .thumbnail-wrapper .modal-thumbnail {
        width: 70px;
        height: 70px;
    }

    .modal-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .modal-info h2 {
        font-size: 18px;
        margin: 0;
    }

    .modal-price {
        order: 2;
    }

    .selected-color-display {
        order: 3;
        margin-bottom: 8px !important;
    }

    .quantity-selector {
        order: 4;
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }

    .add-to-cart-btn {
        order: 5;
        width: 100%;
        padding: 12px;
        font-size: 15px;
        margin-bottom: 10px;
    }

    .modal-cart-items {
        order: 6;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .modal-description-section {
        order: 7;
        margin-top: 10px;
        padding-top: 10px;
    }

    .modal-description-section p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .modal-body {
        padding: 12px;
        gap: 10px;
    }

    #modalMainImage {
        height: 240px;
        border-radius: 6px;
    }

    .thumbnail-wrapper .modal-thumbnail {
        width: 60px;
        height: 60px;
    }

    .color-code-badge {
        font-size: 9px;
        padding: 1px 0;
    }

    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .modal-info h2 {
        font-size: 16px;
        margin: 0;
    }

    .modal-price {
        font-size: 16px;
    }

    .selected-color-value {
        font-size: 18px;
    }

    .quantity-selector {
        width: 100%;
    }

    .quantity-selector button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .quantity-selector input {
        width: 50px;
        font-size: 14px;
    }

    .add-to-cart-btn {
        padding: 10px;
        font-size: 14px;
    }

    .modal-cart-items {
        padding: 10px;
    }

    .modal-cart-header {
        font-size: 13px;
        padding: 6px 10px;
    }

    .modal-cart-item {
        padding: 6px;
        gap: 6px;
    }

    .modal-cart-item-img {
        width: 45px;
        height: 45px;
    }

    .modal-description-section {
        margin-top: 8px;
        padding-top: 8px;
    }

    .modal-description-section p {
        font-size: 12px;
        line-height: 1.5;
    }
}
