/**
 * WooCommerce Bundle Builder Styles
 */

/* Main container */
.woo-bundle-builder-widget {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #f5efe6;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.woo-bundle-builder-header {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Add to bundle button */
.woo-bundle-builder-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9d5a9;
    color: #333;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.woo-bundle-builder-add-btn:hover {
    background-color: #d9b479;
}

.woo-bundle-builder-add-btn.prominent {
    font-size: 18px;
    padding: 15px 25px;
    background-color: #e28c41;
    color: white;
}

.woo-bundle-builder-plus-icon {
    margin-left: 8px;
    font-size: 18px;
    font-weight: bold;
}

/* Bundle items container */
.woo-bundle-builder-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Bundle item */
.woo-bundle-builder-item {
    display: flex;
    align-items: center;
    background-color: #e9d5a9;
    border-radius: 10px;
    padding: 10px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.woo-bundle-builder-item-image {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    overflow: hidden;
    background-color: #fff;
}

.woo-bundle-builder-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.woo-bundle-builder-item-info {
    flex: 1;
    margin-left: 10px;
}

.woo-bundle-builder-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.woo-bundle-builder-item-price {
    font-size: 14px;
    color: #555;
}

.woo-bundle-builder-item-remove {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
}

.woo-bundle-builder-trash-icon:before {
    content: "\f1f8";
    font-family: "FontAwesome", sans-serif;
    font-size: 18px;
}

/* Item animations */
.woo-bundle-builder-item-added {
    animation: fadeInSlide 0.3s ease;
}

.woo-bundle-builder-item-removed {
    animation: fadeOutSlide 0.3s ease forwards;
}

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

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

/* Gifts container */
.woo-bundle-builder-gifts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Gift item */
.woo-bundle-builder-gift {
    background-color: #f8f3ea;
    border-radius: 10px;
    padding: 15px;
    transition: background-color 0.3s ease;
}

.woo-bundle-builder-gift.unlocked {
    background-color: #f8f3ea;
}

.woo-bundle-builder-gift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.woo-bundle-builder-gift-title {
    font-weight: 600;
    font-size: 16px;
}

.woo-bundle-builder-gift-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

/* Toggle switch */
.woo-bundle-builder-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.woo-bundle-builder-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.woo-bundle-builder-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 30px;
}

.woo-bundle-builder-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .woo-bundle-builder-slider {
    background-color: #e28c41;
}

input:disabled + .woo-bundle-builder-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

input:checked + .woo-bundle-builder-slider:before {
    transform: translateX(30px);
}

/* Gift selected product */
.woo-bundle-builder-gift-selected {
    margin-top: 10px;
}

.woo-bundle-builder-gift-product {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    padding: 8px;
}

.woo-bundle-builder-gift-product-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.woo-bundle-builder-gift-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.woo-bundle-builder-gift-product-info {
    flex: 1;
    margin-left: 10px;
}

.woo-bundle-builder-gift-product-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.woo-bundle-builder-gift-product-price {
    font-size: 13px;
}

.woo-bundle-builder-original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.woo-bundle-builder-free-price {
    color: #e28c41;
    font-weight: 600;
}

/* Gift selector button */
.woo-bundle-builder-gift-selector {
    margin-top: 10px;
}

.woo-bundle-builder-gift-select-btn {
    background-color: #e5c396;
    border: none;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woo-bundle-builder-gift-select-btn:hover {
    background-color: #d9b479;
}

/* Price summary */
.woo-bundle-builder-summary {
    background-color: #f8f3ea;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.woo-bundle-builder-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.woo-bundle-builder-summary-item:last-child {
    margin-bottom: 0;
    font-weight: 600;
}

.woo-bundle-builder-summary-label {
    color: #555;
}

.woo-bundle-builder-summary-value {
    font-weight: 500;
}

/* Checkout button */
.woo-bundle-builder-checkout-btn {
    background-color: #e28c41;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woo-bundle-builder-checkout-btn:hover {
    background-color: #d07b32;
}

.woo-bundle-builder-checkout-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.woo-bundle-builder-checkout-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Modal */
.woo-bundle-builder-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.woo-bundle-builder-modal-content {
    position: relative;
    background-color: #f5efe6;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.woo-bundle-builder-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #e5c396;
}

.woo-bundle-builder-modal-title {
    font-weight: 600;
    font-size: 16px;
}

.woo-bundle-builder-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.woo-bundle-builder-modal-tabs {
    display: flex;
    overflow-x: auto;
    padding: 10px 15px;
    background-color: #eee5d8;
    border-bottom: 1px solid #e0d6c7;
}

.woo-bundle-builder-modal-tab {
    padding: 8px 15px;
    margin-right: 5px;
    background-color: #e5c396;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.woo-bundle-builder-modal-tab:hover {
    background-color: #d9b479;
}

.woo-bundle-builder-modal-tab.active {
    background-color: #e28c41;
    color: white;
}

.woo-bundle-builder-modal-products {
    padding: 15px;
    overflow-y: auto;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.woo-bundle-builder-modal-product {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.woo-bundle-builder-modal-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.woo-bundle-builder-modal-product-image {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.woo-bundle-builder-modal-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.woo-bundle-builder-modal-product-info {
    flex: 1;
    margin-left: 10px;
}

.woo-bundle-builder-modal-product-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.woo-bundle-builder-modal-product-price {
    font-size: 14px;
    color: #555;
}

.woo-bundle-builder-modal-product-add {
    width: 30px;
    height: 30px;
    background-color: #e28c41;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.woo-bundle-builder-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #666;
    font-style: italic;
}

.woo-bundle-builder-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #e53935;
}

.woo-bundle-builder-no-products {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #666;
    font-style: italic;
}

/* Gift highlight animation */
.woo-bundle-builder-gift-highlight {
    animation: giftHighlight 2s ease;
}

@keyframes giftHighlight {
    0%, 100% {
        background-color: #f8f3ea;
    }
    25%, 75% {
        background-color: #fadcb9;
    }
}

/* Responsive styles */
@media screen and (max-width: 480px) {
    .woo-bundle-builder-widget {
        padding: 15px;
    }
    
    .woo-bundle-builder-header {
        font-size: 16px;
    }
    
    .woo-bundle-builder-modal-content {
        width: 95%;
    }
    
    .woo-bundle-builder-modal-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .woo-bundle-builder-modal-product-image {
        width: 50px;
        height: 50px;
    }
    
    .woo-bundle-builder-gift-title {
        font-size: 14px;
    }
    
    .woo-bundle-builder-switch {
        width: 50px;
        height: 26px;
    }
    
    .woo-bundle-builder-slider:before {
        height: 18px;
        width: 18px;
    }
    
    input:checked + .woo-bundle-builder-slider:before {
        transform: translateX(24px);
    }
}

/* Accessibility styles */
.woo-bundle-builder-add-btn:focus,
.woo-bundle-builder-checkout-btn:focus,
.woo-bundle-builder-gift-select-btn:focus,
.woo-bundle-builder-switch:focus-within,
.woo-bundle-builder-item-remove:focus,
.woo-bundle-builder-modal-close:focus,
.woo-bundle-builder-modal-tab:focus {
    outline: 2px solid #e28c41;
    outline-offset: 2px;
}

/* Keyboard focus styles for interactive elements */
.woo-bundle-builder-switch:focus-within .woo-bundle-builder-slider {
    box-shadow: 0 0 0 2px #e28c41;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .woo-bundle-builder-add-btn,
    .woo-bundle-builder-checkout-btn,
    .woo-bundle-builder-gift-select-btn,
    .woo-bundle-builder-slider,
    .woo-bundle-builder-modal-tab {
        border: 1px solid currentColor;
    }
    
    input:checked + .woo-bundle-builder-slider {
        background-color: Highlight;
    }
    
    .woo-bundle-builder-slider:before {
        background-color: Canvas;
    }
}