/* Bundle Pro Frontend Styles */

/* Main Container */
.bundle-offer-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bundle-widgets-container {
    margin: 20px 0;
}

.bundle-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Variation label pill */
.bundle-product-variant {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid rgba(17, 24, 39, 0.12);
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Layout */
.bundle-layout-card {
    display: grid;
    gap: 15px;
    grid-template-columns: minmax(0, 1fr);
}

.bundle-layout-card .bundle-product-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 5px;
    display: flex;
    gap: 12px;
    align-items: stretch;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.bundle-layout-card .bundle-product-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bundle-layout-card .bundle-product-checkbox {
    display: none;
}

.bundle-layout-card .bundle-product-added-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    background: #54575b;
    border-radius: 0 5px 0 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.bundle-layout-card .bundle-product-added-badge.show {
    display: flex;
}

.bundle-layout-card .bundle-product-image {
    flex: 0 0 100px;
    max-width: 100px;
}

.bundle-layout-card .bundle-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.bundle-layout-card .bundle-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 85px;
}

.bundle-layout-card .bundle-product-title {
    font-family: 'Mulish';
    font-size: 16px;
    font-weight: 600;
    margin: 5px 0;
    color: #333;
    line-height: 1.3;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bundle-layout-card .bundle-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.bundle-layout-card .bundle-product-card.has-variant .bundle-product-price {
    margin-bottom: 6px;
}

.bundle-layout-card .bundle-product-card.has-variant .bundle-product-meta {
    margin-bottom: 10px;
}

.bundle-layout-card .bundle-product-card.is-variable .bundle-product-price {
    margin-bottom: 6px;
}

.bundle-layout-card .bundle-product-variant {
    font-size: 11px;
    margin-top: 4px;
}

/* Variable product selectors (Woo-like) */
.bundle-variation-wrap {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 220px;
    align-items: flex-start;
}

.bundle-variation-field {
    width: 100%;
}

.bundle-variation-select {
    width: auto;
    max-width: 220px;
    display: inline-block;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    line-height: 1.2;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bundle-variation-select-combined {
    width: auto;
    max-width: 220px;
    display: inline-block;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    line-height: 1.2;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bundle-variation-select:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.bundle-variation-select-combined:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.bundle-variation-error {
    font-size: 12px;
    color: #b91c1c;
}

.bundle-layout-card .bundle-product-price .bundle-price-original {
    text-decoration: line-through;
    color: #272727;
    margin-right: 0;
    font-weight: normal;
    font-size: 15px;
}

.bundle-layout-card .bundle-product-price .bundle-price-sale {
    color: #cc574d;
}

.bundle-layout-card .bundle-discount-badge {
    font-size: 11px;
    color: #cc574d;
    font-weight: 600;
}

.bundle-layout-card .bundle-product-actions {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Inline Layout */
.bundle-layout-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bundle-layout-inline .bundle-product-card {
    flex: 0 0 calc(50% - 6px);
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.bundle-layout-inline .bundle-product-card:hover {
    border-color: #ccc;
}

.bundle-layout-inline .bundle-product-image {
    margin-bottom: 10px;
}

.bundle-layout-inline .bundle-product-image img {
    max-width: 100%;
    height: auto;
}

/* Horizontal Layout */
.bundle-layout-horizontal {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bundle-layout-horizontal .bundle-product-card {
    flex: 1;
    min-width: 200px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* Product Card Common */
.bundle-product-card {
    background: white;
    border-radius: 6px;
}

.bundle-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bundle-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.bundle-product-info {
    display: flex;
    flex-direction: column;
}

.bundle-product-title {
    margin: 0;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.bundle-product-title .bundle-product-title-link {
    color: inherit;
    text-decoration: none;
}

.bundle-product-title .bundle-product-title-link:hover {
    text-decoration: underline;
}

.bundle-product-price {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bundle-product-info .woocommerce-Price-amount.amount {
    color: #171717;
}

.bundle-price-original {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.bundle-price-sale {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
}

.bundle-price-sale .woocommerce-Price-amount.amount {
    color: #c8493f;
}

.bundle-discount-badge {
    display: inline-block;
    background: #ffeaea;
    color: #ff6b6b;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 4px;
}

.bundle-product-price .bundle-discount-badge-inline {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

/* Action Buttons */
.bundle-product-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.bundle-add-btn,
.bundle-remove-btn,
.bundle-view-btn {
    border: none;
    padding: 0 30px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.bundle-add-btn {
    background: #fff;
    color: #111;
    border: 1px solid #111;
}

.bundle-add-btn:hover {
    background: #fff;
    color: #111;
}

.bundle-remove-btn {
    background: #fff;
    color: #111;
    border: 2px solid #111;
}

.bundle-remove-btn:hover {
    background: #fff;
    color: #111;
}

.bundle-view-btn {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.bundle-view-btn:hover {
    background: #f0f0f0;
}

.bundle-quantity-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.bundle-qty-minus,
.bundle-qty-plus {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.bundle-qty-minus:hover,
.bundle-qty-plus:hover {
    background: #e5e5e5;
}

.bundle-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    outline: none;
    font-weight: 600;
}

/* Promotional Banner */

.bundle-offer-banner {
    color: #c13b18;
    padding: 10px 0;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    letter-spacing: 0.06em;
}

.bundle-offer-icon {
    font-size: 20px;
    animation: pulse 1.5s infinite;
}

.bundle-offer-banner .woocommerce-Price-amount.amount, .bundle-offer-banner .woocommerce-Price-currencySymbol {
    color: #c13b18;
    font-size: 16px !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.bundle-offer-text {
    flex: 1;
    min-width: 250px;
}

/* Widget banner (Offer Creator) */
.bundle-widgets-container .bundle-offer-banner {
    justify-content: flex-start;
    text-align: left;
    letter-spacing: 0;
    font-size: 14px;
    padding: 0 0 12px;
}

.bundle-widgets-container .bundle-offer-banner .bundle-offer-text {
    font-size: 16px;
}

.bundle-widgets-container .bundle-offer-banner .bundle-offer-icon {
    display: none;
}

.bundle-offer-product {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
}

.bundle-product-image {
    flex: 0 0 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.bundle-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bundle-product-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.bundle-product-price {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.bundle-price-original {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.bundle-product-price .woocommerce-Price-currencySymbol {
    font-size: 15px !important;
}

.bundle-price-sale {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
}

.bundle-offer-product .bundle-discount-badge {
    display: inline-block;
    background: #ffeaea;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.bundle-add-to-cart-btn {
    background: #222;
    color: white;
    border: 2px solid #222;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
}

.bundle-add-to-cart-btn:hover {
    background: white;
    color: #222;
}

.bundle-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bundle-offer-container .bundle-offer-product {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .bundle-offer-container .bundle-product-image {
        flex: 0 0 auto;
        max-width: 150px;
    }
    
    .bundle-offer-container .bundle-product-price {
        justify-content: center;
    }
    
    .bundle-offer-container .bundle-add-to-cart-btn {
        width: 100%;
    }
    
    .bundle-offer-container .bundle-offer-banner {
        flex-direction: column;
    }
    
    .bundle-offer-container .bundle-offer-text {
        min-width: auto;
    }
}

/* Modal Styles */
.bundle-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bundle-product-modal {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.bundle-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10000;
}

.bundle-modal-close:hover {
    color: #000;
}

.bundle-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px;
}

.bundle-modal-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-modal-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.bundle-modal-info h2 {
    margin-top: 0;
    font-size: 22px;
    color: #333;
}

.bundle-modal-info p {
    color: #666;
    line-height: 1.6;
}

.bundle-modal-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 15px 0;
}

.bundle-modal-add-btn {
    background: #222;
    color: white;
    border: 2px solid #222;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.bundle-modal-add-btn:hover {
    background: white;
    color: #222;
}

/* Responsive for card layout */
@media (max-width: 768px) {
    .bundle-layout-card .bundle-product-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding: 8px 8px 6px;
        gap: 10px;
    }

    .bundle-layout-card .bundle-product-image {
        flex: 0 0 72px;
        max-width: 72px;
        height: 72px;
        align-self: flex-start;
    }

    .bundle-layout-card .bundle-product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 6px;
    }

    .bundle-layout-card .bundle-product-info {
        padding-right: 0 !important;
        justify-content: flex-start;
        flex: 1 1 auto;
        min-width: 0;
    }

    .bundle-layout-card .bundle-product-title {
        font-size: 14px;
        margin: 0 0 4px;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bundle-layout-card .bundle-product-price {
        margin-bottom: 0;
        font-size: 12px;
        gap: 6px;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .bundle-layout-card .bundle-product-price .bundle-price-sale {
        font-size: 14px;
    }

    .bundle-layout-card .bundle-product-price .bundle-price-original {
        font-size: 14px;
    }

    .bundle-layout-card .bundle-product-card.has-variant .bundle-product-price {
        margin-bottom: 0;
    }

    .bundle-layout-card .bundle-product-card.has-variant .bundle-product-meta {
        margin-bottom: 0;
    }

    .bundle-layout-card .bundle-product-variant {
        font-size: 12px;
        margin-top: 4px;
    }

    .bundle-layout-card .bundle-product-price .bundle-discount-badge-inline {
        font-size: 10px;
        padding: 3px 8px;
    }

    .bundle-layout-card .bundle-product-actions {
        position: static;
        margin-left: auto;
        margin-top: 0;
        bottom: auto;
        right: auto;
        gap: 8px;
        align-items: center;
        display: flex !important;
        flex: 0 0 auto;
        flex-shrink: 0;
        z-index: 2;
        align-self: flex-end;
        padding-bottom: 0;
    }

    .bundle-layout-card .bundle-add-btn,
    .bundle-layout-card .bundle-remove-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 72px;
        padding: 0 16px;
        height: 34px;
        line-height: 34px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .bundle-layout-inline .bundle-product-card {
        flex: 0 0 calc(100% - 6px);
    }

    .bundle-modal-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .bundle-offer-container {
        margin: 10px 0;
    }
    
    .bundle-offer-product {
        padding: 15px;
        gap: 15px;
    }

    .bundle-layout-card .bundle-product-card {
        padding: 8px 8px 6px !important;
    }
    
    .bundle-offer-product .bundle-product-title {
        font-size: 16px;
    }
    
    .bundle-offer-product .bundle-price-sale {
        font-size: 18px;
    }
    
    .bundle-add-to-cart-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .bundle-product-card {
        padding: 10px !important;
    }
    
    .bundle-add-btn,
    .bundle-remove-btn,
    .bundle-view-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .bundle-modal-content {
        padding: 15px;
    }
}

/* ===== Product Selector Modal ===== */

.bundle-product-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.bundle-selector-container {
    position: relative;
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.bundle-selector-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bundle-selector-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.bundle-selector-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-selector-close:hover {
    color: #333;
}

.bundle-selector-search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.bundle-selector-search-input,
.bundle-selector-category {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bundle-selector-category {
    min-width: 150px;
}

.bundle-selector-products {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.bundle-product-item {
    cursor: pointer;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.bundle-product-item:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bundle-product-item.selected {
    border-color: #27ae60;
    background: #ecf8f0;
}

.bundle-product-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.bundle-product-item-info {
    padding: 10px;
}

.bundle-product-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bundle-product-item-price {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

.bundle-no-products {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.bundle-selector-pagination {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.bundle-page-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.bundle-page-btn:hover {
    border-color: #999;
}

.bundle-page-btn.active {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.bundle-selector-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bundle-selector-cancel,
.bundle-selector-select {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bundle-selector-cancel {
    background: #f0f0f0;
    color: #333;
}

.bundle-selector-cancel:hover {
    background: #e0e0e0;
}

.bundle-selector-select {
    background: #27ae60;
    color: white;
}

.bundle-selector-select:hover {
    background: #229954;
}

/* Responsive ProductSelector */
@media (max-width: 768px) {
    .bundle-selector-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .bundle-selector-products {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        padding: 10px;
        gap: 10px;
    }
    
    .bundle-selector-search {
        flex-direction: column;
    }
    
    .bundle-selector-category {
        min-width: auto;
    }
}

