/* Contenedor principal del selector de regalos */
.wc-gift-products-selector {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.wc-gift-products-header {
    text-align: center;
    margin-bottom: 30px;
}

.wc-gift-products-header h3 {
    color: #fff;
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.wc-gift-products-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin: 0;
}

/* Grid de productos */
.wc-gift-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    justify-items: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Cuando hay 2 o menos productos, centrarlos */
.wc-gift-products-grid:has(:nth-child(1)):not(:has(:nth-child(3))) {
    grid-template-columns: repeat(auto-fit, minmax(250px, 350px));
    justify-content: center;
}

/* Tarjeta de producto individual */
.wc-gift-product-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    width: 100%;
    max-width: 350px;
}

.wc-gift-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.wc-gift-product-item.selected {
    border-color: #4CAF50;
    background: #f0fff0;
}

/* Imagen del producto */
.wc-gift-product-image {
    margin-bottom: 15px;
    position: relative;
}

.wc-gift-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Detalles del producto */
.wc-gift-product-details h4 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
    min-height: 40px;
}

/* Precios */
.wc-gift-product-price {
    margin-bottom: 15px;
}

.wc-gift-product-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.wc-gift-product-price .gift-price {
    color: #4CAF50;
    font-size: 20px;
    font-weight: 700;
    display: block;
}

/* Botones */
.wc-gift-select-btn,
.wc-gift-selected-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-gift-select-btn {
    background: #667eea;
    color: #fff;
}

.wc-gift-select-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.wc-gift-select-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wc-gift-selected-btn {
    background: #4CAF50;
    color: #fff;
    cursor: default;
}

/* Badge de regalo en el carrito */
.wc-gift-label {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Nota para administradores */
.wc-gift-admin-note {
    display: block;
    color: #666;
    font-size: 11px;
    font-style: italic;
    margin-top: 5px;
    padding: 5px 10px;
    background: #f0f8ff;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
}

/* Cantidad del regalo (sin input) */
.gift-quantity {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-gift-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .wc-gift-products-selector {
        padding: 20px;
    }
    
    .wc-gift-products-header h3 {
        font-size: 22px;
    }
    
    .wc-gift-products-header p {
        font-size: 14px;
    }
    
    .wc-gift-product-item {
        padding: 15px;
    }
    
    .wc-gift-product-details h4 {
        font-size: 14px;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .wc-gift-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Animación de carga */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-gift-products-selector {
    animation: fadeIn 0.5s ease;
}
