/**
 * WooCommerce Cart Addon Suggestions Styles
 * Version: 1.0.0
 */

/* Main Container */
.cart-addon-suggestions {
    margin: 30px 0;
    clear: both;
    animation: slideIn 0.3s ease;
}

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

/* Header Section */
.addon-header {
    background: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #f39c12;
}

.addon-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.addon-header p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
}

/* Products Container */
.products-with-addons-container {
    border: 1px solid #e0e0e0;
    border-top: none;
    background: white;
}

/* Main Product Section */
.main-product-section {
    border-bottom: 1px solid #e0e0e0;
}

.main-product-section:last-child {
    border-bottom: none;
}

/* Product Header Toggle */
.product-header-toggle {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    background: white;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.product-header-toggle:hover {
    background: #f8f9fa;
}

/* Product Thumbnail */
.product-thumb {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Product Info */
.product-header-toggle .product-info {
    flex: 1;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.addon-count {
    font-size: 13px;
    color: #f39c12;
}

/* Expand Toggle Button */
.expand-toggle {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f39c12;
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.expand-toggle span {
    font-size: 20px;
    color: white;
    font-weight: bold;
    line-height: 1;
    display: block;
    pointer-events: none;
}

.expand-toggle.active {
    background: #27ae60;
}

/* Addon Items Section */
.addon-items-section {
    background: #fafafa;
    border-bottom: 2px solid #e0e0e0;
}

.main-product-section:last-child .addon-items-section {
    border-bottom: none !important;
}

/* Cart Addon Item */
.cart-addon-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    border-bottom: 1px solid #e8e8e8;
    background: white;
}

.cart-addon-item:last-child {
    border-bottom: none;
}

/* Addon Image */
.addon-image {
    width: 45px;
    height: 45px;
    margin-right: 15px;
    flex-shrink: 0;
}

.addon-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Addon Info */
.addon-info {
    flex: 1;
    min-width: 0;
}

.addon-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.addon-description {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
}

.area-calculation {
    font-size: 11px;
    color: #28a745;
    margin-top: 3px;
    font-weight: 500;
}

/* Addon Price */
.addon-price {
    margin: 0 15px;
    text-align: right;
}

.price-amount {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.price-suffix {
    font-size: 11px;
    color: #999;
}

/* Addon Controls */
.addon-add-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quantity Wrapper */
.quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.quantity-wrapper button {
    width: 26px;
    height: 26px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.quantity-wrapper button:hover {
    background: #f0f0f0 !important;
}

.quantity-wrapper button:active {
    background: #e0e0e0 !important;
}

.quantity-wrapper .addon-quantity {
    width: 35px;
    height: 26px;
    border: none;
    text-align: center;
    font-size: 13px;
}

.quantity-wrapper .addon-quantity::-webkit-inner-spin-button,
.quantity-wrapper .addon-quantity::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-wrapper .addon-quantity {
    -moz-appearance: textfield;
}

/* Add to Cart Button */
.add-addon-to-cart {
    padding: 5px 14px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.add-addon-to-cart:hover:not(:disabled) {
    background: #e67e22 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.add-addon-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-addon-to-cart.success {
    background: #28a745 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-header-toggle {
        padding: 12px !important;
    }
    
    .cart-addon-item {
        padding: 10px 15px !important;
        flex-wrap: wrap;
    }
    
    .addon-info {
        margin-right: 10px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .addon-price {
        display: none !important;
    }
    
    .addon-add-controls {
        flex-direction: column;
        gap: 8px !important;
        width: 100%;
    }
    
    .quantity-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .add-addon-to-cart {
        width: 100%;
        text-align: center;
    }
    
    .addon-image {
        margin-right: 10px;
    }
}