/**
 * WC Order Bumps - Frontend Styles
 * Clean black/white minimal design
 */

/* Container */
.wcob-order-bumps {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    font-family: inherit;
}

/* Header */
.wcob-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.wcob-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.wcob-heading {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.wcob-subheading {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Products List */
.wcob-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Single Product Row */
.wcob-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.wcob-product:hover {
    border-color: #ccc;
}

.wcob-product.wcob-adding {
    opacity: 0.7;
    pointer-events: none;
}

.wcob-product.wcob-added {
    background: #f5f5f5;
    border-color: #000;
}

/* Toggle Switch */
.wcob-product-toggle {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.wcob-product-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wcob-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 20px;
    transition: background 0.2s ease;
}

.wcob-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.wcob-product-toggle input:checked + .wcob-toggle-slider {
    background: #000;
}

.wcob-product-toggle input:checked + .wcob-toggle-slider:before {
    transform: translateX(16px);
}

/* Product Image */
.wcob-product-image {
    flex-shrink: 0;
    position: relative;
    width: 70px;
    height: 70px;
}

.wcob-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #eee;
}

/* Product Info */
.wcob-product-info {
    flex: 1;
    min-width: 0;
}

.wcob-product-name {
    font-size: 12px;
    font-weight: 500;
    color: #000;
    margin: 0 0 2px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcob-product-desc {
    font-size: 11px;
    color: #888;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pricing - inline layout */
.wcob-product-pricing {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcob-price-original {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.wcob-price-discounted {
    font-size: 12px;
    font-weight: 600;
    color: #000;
}

.wcob-discount-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 2px;
    line-height: 1;
}

/* Actions */
.wcob-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.wcob-add-all {
    width: 100%;
    padding: 10px 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wcob-add-all:hover {
    background: #333;
}

.wcob-add-all:disabled,
.wcob-add-all.wcob-loading {
    background: #666;
    cursor: not-allowed;
}

/* Toast Notifications */
.wcob-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    animation: wcobSlideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wcob-toast-success {
    background: #000;
    color: #fff;
}

.wcob-toast-error {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}

.wcob-toast-icon {
    font-size: 14px;
}

@keyframes wcobSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .wcob-order-bumps {
        padding: 16px;
        margin: 16px 0;
    }

    .wcob-product {
        padding: 10px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .wcob-product-image {
        width: 50px;
        height: 50px;
    }

    .wcob-product-name {
        font-size: 12px;
    }

    .wcob-product-desc {
        display: none;
    }

    .wcob-product-pricing {
        flex-wrap: wrap;
        gap: 4px;
    }

    .wcob-price-discounted {
        font-size: 12px;
    }

    .wcob-price-original {
        font-size: 11px;
    }

    .wcob-heading {
        font-size: 14px;
    }

    .wcob-subheading {
        font-size: 12px;
    }

    .wcob-badge {
        font-size: 9px;
        padding: 3px 6px;
    }

    .wcob-toggle-slider {
        width: 32px;
        height: 18px;
    }

    .wcob-toggle-slider:before {
        height: 14px;
        width: 14px;
    }

    .wcob-product-toggle input:checked + .wcob-toggle-slider:before {
        transform: translateX(14px);
    }

    .wcob-product-toggle {
        width: 32px;
        height: 18px;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .wcob-order-bumps {
        padding: 18px;
        margin: 18px 0;
    }

    .wcob-product-image {
        width: 60px;
        height: 60px;
    }
}

/* Hide blocks injection container initially - JS will show it */
.wcob-blocks-injection {
    display: none !important;
}

/* When shown by JS */
.wcob-blocks-injection[style*="display: block"],
.wcob-blocks-injection[style*="display:block"] {
    display: block !important;
}

/* Ensure visibility in mobile WooCommerce blocks layout */
.wc-block-checkout .wcob-order-bumps,
.wc-block-cart .wcob-order-bumps,
.wp-block-woocommerce-checkout .wcob-order-bumps,
.wp-block-woocommerce-cart .wcob-order-bumps {
    display: block;
    width: 100%;
    box-sizing: border-box;
}
