/* Bundle Details Page Styles */

.bundle-details-section {
    padding: 40px 20px;
    min-height: 600px;
}

span.badge.free-shipping-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 50vmax;
    background-color: var(--header-bg-color);
    padding: 2px 8px;
    width: fit-content;
    font-size: var(--zh-font-size-sm);
    cursor: default;
    transition: all 0.2s ease;
    white-space: nowrap;
}

span.badge.free-shipping-badge p {
    color: var(--muted-text-color) !important;
    font-weight: bold;
    font-size: var(--zh-font-size-sm);
}

.bundle-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1400px;
    margin: 20px;
}

/* Image Gallery */
.bundle-gallery {
    display: flex;
    padding: 20px;
    gap: 15px;
    position: sticky;
    top: 20px;
    align-items: center;
    flex-direction: row-reverse;
}

.main-image {
    display: flex;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.main-image img {
    width: 100%;
    height: min-content;
    object-fit: scale-down;
}

.thumbnail-gallery::-webkit-scrollbar {
    display: none;
}

.thumb-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.thumb-nav-btn i {
    margin: 0 !important;
}

.thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: white;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #f5af19;
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

/* Bundle Info Panel */
.bundle-info-panel {
    padding: 20px;
}

.bundle-info-panel h1 {
    text-align: center;
}

.bundle-detail-title {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 15px;
    font-weight: 700;
}

.bundle-detail-description {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.bundle-price-box {
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--zh-white);
    padding: 10px;
    border-radius: 12px;
    /* margin-bottom: 30px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bundle-price-box .price-box {
    width: 100%;
    display: flex;
    margin: 0 15px;
    justify-content: space-between;
    align-items: center;
}

.bundle-price-box .price-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f5af19;
}

.bundle-price-box .price-label {
    font-size: 1.2rem;
    opacity: 0.8;
}

.price-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

html[dir="rtl"] .price-content {
    align-items: flex-start;
}

html[dir="ltr"] .price-content {
    align-items: flex-start;
}

.total-price-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.original-price-strikethrough {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    margin-left: 10px;
}

.savings-row {
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 8px;
    margin-top: 8px;
    width: 100%;
}

.savings-amount-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.savings-value {
    color: #10b981;
    font-weight: 700;
    font-size: 1.15rem;
}

.savings-label {
    font-size: 0.95rem;
    color: #10b981;
    opacity: 0.95;
}

.savings-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Product Selection Section */
.product-selection-section {
    background: var(--background-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 10px;
}

.product-selection-section h3 svg {
    width: 24px;
    height: 24px;
    fill: var(--icon-header-color, var(--zh-light));
    transition:
        fill 0.3s ease,
        transform 0.3s ease;
}

.product-selection-section h3 svg:hover {
    fill: var(--icon-header-hover-color, gold);
    transform: scale(1.1);
}

.product-slots {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.product-slot {
    flex: 1;
    width: 100px;
    /* max-width: 100px; */
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.product-slot:hover {
    border-color: #f5af19;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-slot.filled {
    border-style: solid;
    border-color: #10b981;
}

.product-slot .slot-label {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 8px;
    white-space: nowrap;
}

.product-slot:hover .slot-label {
    color: var(--primary-color);
    background: var(--secondary-color);
    border: 0.8px solid var(--primary-color);
}

.product-slot:hover .empty-slot-content svg {
    fill: var(--secondary-color);
}

.empty-slot-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.empty-slot-content svg {
    width: 40%;
    height: 40%;
}

.product-slot .slot-icon {
    font-size: 2rem;
    color: #ddd;
    margin-bottom: 10px;
}

.product-slot.filled .empty-slot-content {
    display: none;
}

.product-slot .slot-text {
    font-size: 0.85rem;
    color: #999;
}

/* removed duplicate slot-text hide */

.product-slot .selected-product {
    display: none;
}

.product-slot.filled .selected-product {
    display: block;
}

.product-slot .selected-product img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-slot .selected-product .product-name {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}

.product-slot .slot-pricing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 5px;
}

.product-slot .slot-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f5af19;
}

.product-slot .slot-discount-badge {
    background: #10b981;
    color: white;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-slot .slot-discount-badge span {
    white-space: nowrap;
}

/* Quantity Section */
.quantity-section {
    margin-bottom: 25px;
}

.quantity-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #f5af19;
    color: #fff;
    border-color: #f5af19;
}

.quantity-controls input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
}

/* Add to Cart Button */
.btn-add-to-cart {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-add-to-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 175, 25, 0.4);
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Product Selection Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.product-modal-content {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.modal-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-content: center;
    margin: 10px auto;
}

.bundle-category-badge {
    border-radius: 50vmax;
    display: flex;
    background-color: var(--header-bg-color);
    color: var(--header-text-color);
    padding: 2px 8px;
    margin: 6px 2px;
    cursor: default;
    line-height: inherit;
    transition: all 0.2s ease;
    border: none;
    width: fit-content;
    font-size: var(--zh-font-size-sm);
    box-shadow: 1px 1px 4px 1px var(--icon-primary-color);
    align-items: center;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #f5af19;
}

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

.product-item {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-item:hover {
    border-color: #f5af19;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-item img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-item .product-name {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.product-item .product-price {
    color: #f12711;
    font-weight: 700;
}

.notification.notification-error {
    min-width: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .bundle-details-grid {
        grid-template-columns: 1fr;
        margin: 0;
        gap: 10px;
        width: min-content;
    }

    .bundle-gallery {
        width: min-content;
        position: relative;
        display: flex;
        top: 0px;
        flex-direction: column;
        padding: 10px 0;
        gap: 10px;
    }

    .product-selection-section {
        width: 100%;
        padding: 10px;
        margin-bottom: 10px;
    }

    .main-image {
        margin-bottom: 5px;
    }

    .main-image img {
        width: 100%;
        height: min-content;
        object-fit: contain;
    }

    .thumb-nav-btn.next i {
        transform: rotate(-90deg);
    }

    .thumbnail {
        width: 55px;
        height: 55px;
        border-radius: 6px;
    }

    .bundle-info-panel {
        width: stretch;
        padding: 10px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .btn-detail.btn-checkout-mini {
        margin: 10px;
        width: 95%;
        height: 5vh;
    }

    .bundle-price-box .price-value,
    .bundle-price-box .price-label {
        font-size: 1.1rem;
        white-space: nowrap;
    }

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

    .product-slots {
        width: 100%;
        /* justify-content: center; */
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        justify-content: center;
        margin: 10px auto;
        justify-items: center;
        align-items: center;
    }

    .product-slot {
        /* min-width: 130px; */
        width: stretch;
    }

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

    .bundle-actions {
        width: 100%;
    }

    .bundle-price-box {
        flex-direction: column;
        gap: 8px;
    }

    .notification.notification-error {
        min-width: 80%;
    }
}