/* Reuse variables from base.html */



/* --- Main Layout --- */
body {
    background-color: var(--secondary-bg);
    color: var(--text-main);
    overflow-x: hidden;
    font-family: "IBM Plex Sans Arabic", sans-serif;
}

.main-container {
    padding-top: 20px;
    min-height: 100vh;
    padding-bottom: 40px;
}

.product-section {
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

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

/* --- Product Images (Swipers - PRESERVED) --- */
.product-images {
    position: sticky;
    top: 100px;
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.main-swiper-container {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #f8fafc;
    position: relative;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
}

.main-swiper {
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.main-swiper:active {
    cursor: grabbing;
}

.main-swiper .swiper-wrapper {
    display: flex;
    align-items: center;
    width: 100% !important;
    height: 100% !important;
}

.main-swiper .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    flex-shrink: 0;
}

.main-swiper .swiper-slide-active {
    opacity: 1;
}

.main-swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: grab;
    width: 100% !important;
    height: 100% !important;
}

.main-swiper-slide:active {
    cursor: grabbing;
}

.main-swiper-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    /* Changed back to contain for better product view */
    transition: transform 0.3s ease;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-position: center !important;
}

.main-swiper-slide:hover img {
    transform: scale(1.05);
}

/* Prevent Swiper from changing size after load */
.main-swiper-container * {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.main-swiper-container .swiper {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.main-swiper-container .swiper-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.main-swiper-container .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.main-swiper-container img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Force Swiper to stay in container */
.main-swiper-container {
    contain: layout style size !important;
}

.main-swiper-container .swiper {
    contain: layout style size !important;
}

.main-swiper-container .swiper-wrapper {
    contain: layout style size !important;
}

.main-swiper-container .swiper-slide {
    contain: layout style size !important;
}

/* Prevent images from growing */
.main-swiper-container img,
.thumbnail-swiper-container img {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.thumbnail-swiper-container {
    width: 100%;
    height: 100px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    contain: layout style size !important;
}

.thumbnail-swiper {
    width: 100%;
    height: 100%;
    cursor: grab;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    contain: layout style size !important;
}

.thumbnail-swiper:active {
    cursor: grabbing;
}

.thumbnail-swiper .swiper-wrapper {
    display: flex;
    align-items: center;
}

.thumbnail-swiper .swiper-slide {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    contain: layout style size !important;
}

.thumbnail-swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    opacity: 0.7;
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    contain: layout style size !important;
    border: 2px solid transparent;
}

.thumbnail-swiper-slide:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.thumbnail-swiper-slide.swiper-slide-thumb-active {
    opacity: 1;
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(255, 159, 67, 0.2);
}

.thumbnail-swiper-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-position: center !important;
}

/* Swiper Navigation Buttons */
.swiper-button-next,
.swiper-button-prev {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 45px !important;
    height: 45px !important;
    margin-top: -20px;
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Control Swiper default icon size */
    --swiper-navigation-size: 16px;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #fff;
    color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 159, 67, 0.5);
    border-color: var(--primary-color);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 14px !important;
    font-weight: bold;
}

/* Position adjustments */
.swiper-button-next {
    right: 15px;
}

.swiper-button-prev {
    left: 15px;
}

/* Swiper Pagination */
.swiper-pagination {
    bottom: 15px !important;
    z-index: 10;
}

.swiper-pagination-bullet {
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    width: 8px;
    height: 8px;
    margin: 0 6px !important;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(255, 159, 67, 0.3);
}

/* --- Product Info --- */
.product-info {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.product-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-price-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.product-current-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.product-old-price {
    font-size: 1.2rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-badge {
    background: var(--danger);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.product-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Buttons */
.form-buttons {
    display: grid;
    gap: 15px;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 159, 67, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 159, 67, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-3px);
}

/* --- Similar Products (Card Style from Home) --- */
.similar-products-section {
    padding: 4rem 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 10px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

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

/* Product Card (Copied & Adapted from Home) */
.product-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-hover);
}

.card-img-wrapper {
    position: relative;
    padding-top: 110%;
    overflow: hidden;
    background-color: #f8fafc;
}

.card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.12);
}

.badges-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.badge-custom {
    width: fit-content;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.badge-sale {
    background: rgba(239, 68, 68, 0.95);
}

.badge-new {
    background: rgba(16, 185, 129, 0.95);
}

.actions-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s var(--bounce);
    z-index: 3;
}

.product-card:hover .actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--bounce);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.15);
}

.card-body-custom {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-cat {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-title-card {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* height: 2.8em; */
    transition: color 0.2s;
}

.product-title-card:hover {
    color: var(--primary-color);
}

.price-wrapper {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 1.2rem;
}

.price-current {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
}

.price-old {
    font-size: 0.9rem;
    color: #cbd5e1;
    text-decoration: line-through;
    font-weight: 500;
}

.btn-add-cart {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #334155;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn-add-cart:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.3);
    transform: translateY(-2px);
}

/* --- Scroll to Top --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* --- Animations --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease;
}

.visible {
    opacity: 1;
    transform: translate(0);
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0;
    }

    .product-images {
        position: static;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .main-swiper-container {
        height: 350px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-current-price {
        font-size: 1rem;
    }

    .product-old-price {
        font-size: 1rem;
    }

    .product-price-container {
        gap: 10px;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

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

    .card-body-custom {
        padding: 1rem;
    }

    .btn-add-cart {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* --- Toast Notification --- */
.toast-success {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    z-index: 9999;
    min-width: 340px;
    max-width: 90%;
    direction: rtl;
    overflow: hidden;
    animation: slideDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), fadeOut 0.5s ease-in 4.5s forwards;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.toast-icon {
    width: 45px;
    height: 45px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Order Now Button (For Similar Products) */
.btn-order-now {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    background: #ff9f43;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    margin-top: 10px;
}

.btn-order-now:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.4);
    color: #fff;
}

.btn-order-now::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: 0.5s;
}

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

/* Out of Stock Button (For Similar Products) */
.btn-out-of-stock {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    background: #ef4444;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    margin-top: 10px;
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-out-of-stock:hover {
    background: #dc2626;
    color: #fff;
}

.toast-message {
    flex: 1;
}

.toast-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.toast-description {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.3s;
}

.toast-close:hover {
    color: #10b981;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: #10b981;
    width: 100%;
    transform-origin: right;
    animation: progress 5s linear forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
        pointer-events: none;
    }
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 480px) {
    .toast-success {
        width: 90%;
        min-width: auto;
        top: 80px;
    }
}

/* Favorites Button */
.btn-favorite {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid #f1f5f9;
    background: #fff;
    color: var(--text-main);
    cursor: pointer;
}

.btn-favorite:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fff0f0;
    transform: translateY(-3px);
}

.btn-favorite i {
    transition: all 0.3s ease;
}

.btn-favorite:hover i {
    transform: scale(1.2);
}

/* --- Toast Error Notification --- */
.toast-error {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    z-index: 9999;
    min-width: 340px;
    max-width: 90%;
    direction: rtl;
    overflow: hidden;
    animation: slideDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), fadeOut 0.5s ease-in 4.5s forwards;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.toast-error .toast-icon {
    width: 45px;
    height: 45px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-error .toast-close:hover {
    color: #ef4444;
}

.toast-error .toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: #ef4444;
    width: 100%;
    transform-origin: right;
    animation: progress 5s linear forwards;
}

@media (max-width: 480px) {
    .toast-error {
        width: 90%;
        min-width: auto;
        top: 80px;
    }
}

/* --- Product Out of Stock --- */
.product-out-of-stock {
    background: #fff5f5;
    border: 2px dashed #fc8181;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeIn 0.5s ease;
    box-shadow: 0 10px 30px rgba(245, 101, 101, 0.1);
    transition: all 0.3s ease;
}

.product-out-of-stock:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(245, 101, 101, 0.15);
}

.product-oos-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 10px 20px rgba(245, 101, 101, 0.3);
    animation: pulse 2s infinite;
}

.product-oos-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-oos-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #c53030;
    margin: 0;
}

.product-oos-text {
    color: #718096;
    font-size: 1.1rem;
    margin: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(245, 101, 101, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Attributes Styles */
.product-attributes {
    margin: 1.5rem 0;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.attribute-group {
    margin-bottom: 1.2rem;
}

.attribute-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attribute-option {
    cursor: pointer;
    position: relative;
}

.attribute-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s ease;
}

.attribute-option input[type="radio"]:checked + .option-label {
    background-color: #e1bf00;
    color: white;
    border-color: #e1bf00;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.attribute-option:hover .option-label {
    background-color: #e9e9e9;
}

.attribute-option input[type="radio"]:checked:hover + .option-label {
    background-color: #357abd;
}
    
        :root {
            --primary-color: #dfbe00; /* ZINOU ABT Gold */
            --primary-hover: #c5a600;
            --text-main: #050A15; /* Dark text for light cards */
            --text-secondary: #64748b;
            --bg-page: #050A15; /* Keep page dark */
            --bg-card: #ffffff; /* Pure white card */
            --border-light: rgba(0, 0, 0, 0.08);
            --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 15px 35px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.15);
            --radius-lg: 24px;
            --radius-md: 16px;
            --radius-sm: 8px;
        }

        body {
            background-color: var(--bg-page);
            font-family: 'IBM Plex Sans Arabic', sans-serif;
            color: var(--text-main);
            overflow-x: hidden;
        }

        /* Container */
        .checkout-wrapper {
            max-width: 1280px;
            margin: 40px auto;
            padding: 0 20px;
        }

        /* Steps Indicator (Visual Only) */
        .checkout-steps {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            margin: 0 auto 40px;
            padding: 15px 40px;
            background: #ffffff;
            border-radius: 50px;
            border: 1px solid var(--border-light);
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            color: var(--text-secondary);
            font-weight: 700;
            font-size: 0.95rem;
            position: relative;
            left: 50%;
            transform: translateX(-50%);
        }

        .step-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .step-item.active {
            color: var(--primary-color);
        }

        .step-number {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: #f1f5f9;
            border: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            color: var(--text-secondary);
            transition: all 0.4s ease;
        }

        .step-item.active .step-number {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
            border-color: transparent;
            color: #ffffff;
            box-shadow: 0 5px 15px rgba(223, 190, 0, 0.4);
            transform: scale(1.1);
        }

        .step-divider {
            width: 50px;
            height: 2px;
            background: #e2e8f0;
        }

        /* Layout Grid */
        .checkout-grid {
            display: grid;
            grid-template-columns: 1.6fr 1fr;
            gap: 40px;
            align-items: start;
        }

        /* Cards Generic */
        .glass-card {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-sm);
            padding: 40px;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: hidden;
        }

        .glass-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; height: 4px;
            background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .glass-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-4px);
        }

        .glass-card:hover::before {
            opacity: 1;
        }

        /* Section Settings */
        .section-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-light);
        }

        .section-title {
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--text-main);
            margin: 0;
        }

        .section-icon {
            color: var(--primary-color);
            font-size: 1.4rem;
        }

        /* Form Controls */
        .input-group {
            margin-bottom: 24px;
            position: relative;
        }

        .input-label {
            display: block;
            margin-bottom: 10px;
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text-main);
            letter-spacing: 0.5px;
        }

        .input-control {
            width: 100%;
            padding: 18px 20px;
            background: #f8fafc;
            border: 1.5px solid var(--border-light);
            border-radius: var(--radius-md);
            font-size: 1rem;
            color: var(--text-main);
            transition: all 0.3s ease;
            font-family: inherit;
        }

        .input-control:focus {
            background: #ffffff;
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 10px 20px rgba(223, 190, 0, 0.1);
        }

        .input-control::placeholder {
            color: #94a3b8;
        }
        
        select.input-control option {
            background: #ffffff;
            color: var(--text-main);
        }

        /* Custom Radio Tiles */
        .radio-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 16px;
            margin-top: 12px;
        }

        .radio-tile-label {
            cursor: pointer;
            position: relative;
        }

        .radio-tile-input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .radio-tile-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 25px 15px;
            background: #ffffff;
            border: 1.5px solid var(--border-light);
            border-radius: var(--radius-md);
            text-align: center;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            height: 100%;
            position: relative;
            overflow: hidden;
        }

        .radio-tile-icon {
            font-size: 2.5rem;
            color: #cbd5e1;
            margin-bottom: 15px;
            transition: all 0.4s ease;
        }

        .radio-tile-text {
            font-weight: 800;
            font-size: 1.05rem;
            color: var(--text-main);
            z-index: 10;
            transition: all 0.3s ease;
        }

        .radio-tile-price {
            margin-top: 8px;
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-secondary);
            transition: all 0.3s ease;
        }

        /* Selected State */
        .radio-tile-input:checked + .radio-tile-content {
            border-color: var(--primary-color);
            background: #ffffff;
            box-shadow: 0 15px 30px rgba(223, 190, 0, 0.15);
            transform: translateY(-5px);
        }

        .radio-tile-input:checked + .radio-tile-content::after {
            content: "\f00c"; /* FontAwesome check */
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            position: absolute;
            top: 15px;
            right: 15px;
            color: var(--primary-color);
            font-size: 1.2rem;
        }

        .radio-tile-input:checked + .radio-tile-content .radio-tile-icon {
            color: var(--primary-color);
            transform: scale(1.1) translateY(-2px);
        }
        
        .radio-tile-input:checked + .radio-tile-content .radio-tile-price {
            color: var(--primary-color);
        }

        .radio-tile-input:disabled + .radio-tile-content {
            opacity: 0.5;
            background: #f1f5f9;
            cursor: not-allowed;
            transform: none;
        }

        /* Error Messages */
        .error-message {
            color: #ef4444;
            font-size: 0.85rem;
            margin-top: 6px;
            display: none;
            font-weight: 600;
        }

        /* Support old class used in JS if any */
        .phone-error {
            color: #ef4444;
            font-size: 0.85rem;
            margin-top: 6px;
            display: none; /* JS toggles this with .show */
            font-weight: 600;
        }
        .phone-error.show {
            display: block;
        }

        .input-control.error {
            border-color: #ef4444;
            background: rgba(239, 68, 68, 0.05);
            box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
        }

        /* Additional Sections (Hidden by default) */
        .expandable-section {
            background: #f8fafc;
            border-radius: var(--radius-md);
            padding: 30px;
            border: 1px dashed var(--border-light);
            margin-top: 25px;
            display: none; /* JS toggles this */
            animation: slideDown 0.3s ease-out forwards;
        }

        /* Support both .active (new CSS) and .show (old JS expectation) */
        .expandable-section.active, .delivery-address.show, .expandable-section.show {
            display: block;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Order Summary (Sticky) */
        .summary-card {
            position: sticky;
            top: 100px; /* Adjust based on your header height */
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border-light);
            overflow: hidden;
        }

        .summary-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; height: 4px;
            background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .summary-card:hover::before {
            opacity: 1;
        }

        .summary-header {
            background: #f8fafc;
            padding: 25px 24px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .summary-title {
            margin: 0;
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--primary-color);
        }

        .summary-body {
            padding: 24px;
        }

        .cart-items {
            max-height: 350px;
            overflow-y: auto;
            margin-bottom: 20px;
            padding-right: 5px;
        }

        .cart-items::-webkit-scrollbar {
             width: 4px;
        }
        .cart-items::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }

        .cart-item {
            display: grid;
            grid-template-columns: 85px 1fr;
            gap: 20px;
            margin-bottom: 25px;
            padding-bottom: 25px;
            border-bottom: 1px dashed var(--border-light);
            transition: all 0.3s ease;
        }

        .cart-item:hover {
            background: #f8fafc;
            border-radius: 12px;
            padding: 10px 10px 25px 10px;
            margin: -10px -10px 15px -10px;
        }

        .cart-item-img {
            width: 85px;
            height: 85px;
            border-radius: 14px;
            object-fit: cover;
            border: 1px solid var(--border-light);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .cart-item-info h4 {
            margin: 0 0 4px 0;
            font-size: 0.95rem;
            font-weight: 700;
            line-height: 1.3;
        }

        .cart-item-meta {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 8px;
            font-weight: 600;
        }

        .price-breakdown {
            margin-top: 10px;
        }

        .price-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
            color: var(--text-secondary);
            font-size: 0.95rem;
        }

        .price-row.total {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-light);
            color: var(--text-main);
            font-weight: 900;
            font-size: 1.5rem;
            align-items: center;
        }

        .btn-confirm {
            width: 100%;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
            color: #ffffff;
            border: none;
            padding: 20px;
            border-radius: var(--radius-md);
            font-size: 1.2rem;
            font-weight: 900;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            margin-top: 25px;
            box-shadow: 0 10px 25px rgba(223, 190, 0, 0.3);
            position: relative;
            overflow: hidden;
        }

        .btn-confirm::after {
            content: '';
            position: absolute;
            top: 0; left: -100%; width: 100%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
            transition: 0.6s;
        }

        .btn-confirm:hover::after {
            left: 100%;
        }

        .btn-confirm:hover {
            transform: translateY(-4px);
            box-shadow: 0 15px 35px rgba(223, 190, 0, 0.5);
            color: #ffffff;
        }

        /* Promo Code Compact */
        .promo-container {
            margin-top: 25px;
            background: #f8fafc;
            padding: 20px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }

        .promo-input-row {
            display: flex;
            gap: 12px;
        }

        .btn-apply {
            background: var(--text-main);
            color: #ffffff;
            border: none;
            padding: 0 25px;
            border-radius: var(--radius-md);
            font-weight: 800;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-apply:hover {
            background: var(--primary-color);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(223, 190, 0, 0.3);
            color: #ffffff;
        }

        .btn-apply:disabled {
            opacity: 0.7;
            cursor: not-allowed;
        }

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

        .empty-cart-state i {
            display: block;
            margin-bottom: 15px;
            color: #cbd5e1;
        }

        /* Popup */
        .loading-overlay, .popup-overlay {
            position: fixed;
            inset: 0;
            background: rgba(5, 10, 21, 0.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s;
        }

        /* Support both classes */
        .loading-overlay.visible, .popup-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .loading-content, .popup-content {
            background: var(--bg-card);
            padding: 30px 50px;
            border-radius: var(--radius-lg);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
            text-align: center;
            border: 1px solid var(--border-light);
            color: var(--text-main);
        }

        .spinner, .popup-spinner {
            width: 45px;
            height: 45px;
            border: 3px solid rgba(0, 0, 0, 0.05);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 15px;
        }

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

        /* Responsive Breakpoints */
        @media (max-width: 992px) {
            .checkout-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            /* Reorder columns: Summary first, then Form */
            .summary-column {
                order: -1;
            }

            .form-column {
                order: -2;
            }

            .summary-card {
                position: static;
                margin-bottom: 0;
            }

            .checkout-steps {
                display: none;
            }
        }

        @media (max-width: 640px) {
            .input-group, .section-title {
              margin-bottom: 20px;
            }

            .glass-card {
                padding: 20px;
            }

            .radio-grid {
                grid-template-columns: 1fr 1fr;
                gap: 10px;
            }

            .radio-tile-content {
                padding: 15px 10px;
            }

            .radio-tile-icon {
                font-size: 1.8rem;
                margin-bottom: 10px;
            }

            .radio-tile-text {
                font-size: 0.9rem;
            }

            .radio-tile-price {
                font-size: 0.8rem;
                margin-top: 5px;
            }
        }

        .unsupported-price-text {
            color: #94a3b8 !important;
            text-decoration: line-through;
            font-size: 0.85rem;
        }

        /* Quantity Controls */
        .quantity-wrapper {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-top: 10px;
        }

        .quantity-btn {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid var(--border-light);
            background: white;
            color: var(--text-main);
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quantity-btn:hover:not(:disabled) {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .quantity-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .quantity-display {
            font-weight: 700;
            font-size: 1.1rem;
            min-width: 20px;
            text-align: center;
        }

    
