/**
 * Gift Box Builder Styles
 */

/* Hide standard add to cart form on gift box products */
body.single-product .product.product-type-simple form.cart {
    display: none !important;
}

.gift-box-builder {
    margin: 30px 0;
    padding: 30px;
    background: #fff;
    border: 2px solid #9b51e0;
    border-radius: 8px;
}

.gift-box-description {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f5ff;
    border-left: 4px solid #9b51e0;
    color: #333;
}

.gift-box-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.gift-box-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.gift-box-instruction {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

.gift-box-counter {
    display: inline-block;
    padding: 12px 24px;
    background: #f5f5f5;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.gift-box-counter.complete {
    background: #9b51e0;
    color: white;
}

.gift-box-counter .selected-count {
    color: #9b51e0;
    font-size: 22px;
}

.gift-box-counter.complete .selected-count {
    color: white;
}

/* Product Grid */
.gift-box-products {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.gift-box-product-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 2px solid #9b51e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    gap: 20px;
}

.gift-box-product-item:hover {
    box-shadow: 0 4px 12px rgba(155, 81, 224, 0.15);
}

.gift-box-product-item .product-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.gift-box-product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.gift-box-product-item .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gift-box-product-item .product-name {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
    font-weight: 600;
}

.gift-box-product-item .product-price {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #9b51e0;
}

/* Checkbox Controls */
.product-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Override Flatsome theme styles with more specific selectors */
.gift-box-builder .product-checkbox-input,
.gift-box-builder input.product-checkbox-input,
.gift-box-builder input[type="checkbox"].product-checkbox-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 28px !important;
    height: 28px !important;
    border: 3px solid #9b51e0 !important;
    border-radius: 6px !important;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    margin-right: 10px;
    background: white !important;
    box-shadow: none !important;
}

.gift-box-builder .product-checkbox-input:hover,
.gift-box-builder input.product-checkbox-input:hover {
    background: #f9f5ff !important;
    transform: scale(1.05);
}

.gift-box-builder .product-checkbox-input:checked,
.gift-box-builder input.product-checkbox-input:checked {
    background: #7a3db8 !important;
    border-color: #7a3db8 !important;
}

.gift-box-builder .product-checkbox-input:checked::after,
.gift-box-builder input.product-checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white !important;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-label {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.gift-box-product-item.selected {
    border-color: #7a3db8;
    background: #f9f5ff;
    box-shadow: 0 4px 12px rgba(122, 61, 184, 0.3);
}

/* Summary Section */
.gift-box-summary {
    padding: 25px;
    background: #f9f5ff;
    border-radius: 8px;
    border: 2px solid #9b51e0;
}

.price-breakdown {
    margin-bottom: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 16px;
    color: #333;
}

.price-row.total {
    border-top: 2px solid #9b51e0;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #9b51e0;
}

.gift-box-actions {
    text-align: center;
}

.gift-box-add-to-cart {
    width: 100%;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    background: #9b51e0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-box-add-to-cart:not(:disabled):hover {
    background: #7a3db8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 81, 224, 0.3);
}

.gift-box-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.gift-box-error {
    color: #e74c3c;
    font-weight: 600;
    margin-top: 15px;
    padding: 10px;
    background: #ffe5e5;
    border-radius: 4px;
    border: 1px solid #e74c3c;
}

/* Cart Display */
.gift-box-contents {
    background: #f9f5ff;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 3px solid #9b51e0;
}

/* Responsive */
@media (max-width: 768px) {
    .gift-box-builder {
        padding: 20px;
    }
    
    .gift-box-product-item {
        padding: 15px;
        gap: 15px;
    }
    
    .gift-box-product-item .product-image {
        width: 80px;
        height: 80px;
    }
    
    .gift-box-product-item .product-name {
        font-size: 16px;
    }
    
    .gift-box-product-item .product-price {
        font-size: 18px;
    }
    
    .gift-box-header h3 {
        font-size: 24px;
    }
    
    .price-row {
        font-size: 14px;
    }
    
    .price-row.total {
        font-size: 18px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .gift-box-product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .gift-box-product-item .product-image {
        width: 100%;
        height: auto;
        max-width: 150px;
    }
    
    .gift-box-product-item .product-info {
        align-items: center;
    }
}
