/* Frontend styles for Box Builder UI */

/* Container Layout */
.box-builder-container {
    clear: both;
    width: 100%;
    margin: 60px 0;
    padding: 40px 0;
    border-top: 2px solid #e5e7eb;
    background: #f8fafc;
    position: relative;
    z-index: 1;
}

.box-builder-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Box Builder Main */
#cwbb_box_builder {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 0 auto;
    max-width: 800px;
}

/* Category Headers */
.cwbb_category h3 {
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* Category Limits */
.category-limit {
    font-weight: 500;
    font-size: 0.9rem;
    color: #6b7280;
    margin-left: 12px;
}

.category-selected-count {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Flavor Items */
.cwbb_flavor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.cwbb_flavor:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.cwbb_flavor label {
    flex: 1;
    font-weight: 500;
    margin-right: 15px;
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    width: 120px;
}

.quantity-control button {
    width: 36px;
    height: 36px;
    border: none;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.quantity-control button:hover {
    background: #e5e7eb;
}

.quantity-value {
    flex: 1;
    text-align: center;
    font-weight: 600;
    padding: 0 8px;
    color: #111827;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    min-width: 40px;
}

/* Error Messages */
.cwbb_quantity_error {
    margin-top: 8px;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 4px 8px;
    background: #fef2f2;
    border-radius: 4px;
}

/* Disabled add to cart button styles */
button.single_add_to_cart_button:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Persistent message near add to cart button */
#cwbb_option_message {
    margin-top: 10px;
    font-weight: 600;
    color: #dc2626;
    font-size: 1rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .box-builder-container {
        margin: 30px 0;
        padding: 30px 0;
    }
    
    .box-builder-section {
        padding: 0 15px;
    }
    
    #cwbb_box_builder {
        padding: 25px;
        border-radius: 12px;
    }

    .cwbb_flavor {
        padding: 20px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .cwbb_flavor label {
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    .quantity-control {
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

    .quantity-control button {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        background: #f3f4f6;
        color: #111827;
        transition: background-color 0.3s ease;
    }

    .quantity-control button:hover,
    .quantity-control button:focus {
        background: #e5e7eb;
        outline: none;
    }

    .quantity-value {
        font-size: 1.25rem;
        padding: 0 12px;
    }
}