/* WooCommerce Custom Quantity Styles */

/* Agregar etiqueta "Cantidad:" */
.quantity::before {
    content: 'Cantidad:';
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
    font-family: inherit;
}

/* Contenedor principal */
.quantity {
    position: relative;
    margin-bottom: 15px;
}

/* Wrapper del input */
.quantity .qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
}

.quantity .qty-wrapper:hover {
    border-color: #ff5722;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.15);
}

/* Botones de cantidad */
.quantity .qty-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    border: none;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
}

.quantity .qty-btn:hover {
    background: linear-gradient(135deg, #f4511e 0%, #ff5722 100%);
    transform: scale(1.05);
}

.quantity .qty-btn:active {
    transform: scale(0.95);
}

.quantity .qty-btn.minus {
    border-radius: 6px 0 0 6px;
}

.quantity .qty-btn.plus {
    border-radius: 0 6px 6px 0;
}

/* Input de cantidad */
.quantity input.qty {
    width: 70px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #f9f9f9;
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0;
    padding: 0;
}

.quantity input.qty::-webkit-outer-spin-button,
.quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity input.qty:focus {
    outline: none;
    background: #fff;
}

/* Para página de producto individual */
.single-product .quantity::before {
    font-size: 16px;
    margin-bottom: 12px;
}

.single-product .quantity .qty-wrapper {
    border-width: 2px;
}

.single-product .quantity .qty-btn {
    width: 45px;
    height: 45px;
    font-size: 22px;
}

.single-product .quantity input.qty {
    width: 80px;
    height: 45px;
    font-size: 18px;
}

/* Para carrito */
.woocommerce-cart .quantity::before {
    display: none;
}

.woocommerce-cart .quantity .qty-wrapper {
    border-width: 1px;
}

/* Animación de pulso al cambiar */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.quantity.changed input.qty {
    animation: pulse 0.3s ease;
}

/* Estilo moderno alternativo - descomenta si prefieres este */
/*
.quantity .qty-btn {
    background: #333;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin: 2px;
}

.quantity .qty-btn:hover {
    background: #ff5722;
}

.quantity .qty-wrapper {
    border-radius: 25px;
    padding: 2px;
}
*/

/* Responsive */
@media (max-width: 768px) {
    .quantity::before {
        font-size: 14px;
    }
    
    .quantity .qty-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .quantity input.qty {
        width: 60px;
        height: 38px;
        font-size: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .quantity::before {
        color: #e0e0e0;
    }
    
    .quantity .qty-wrapper {
        border-color: #444;
        background: #2a2a2a;
    }
    
    .quantity input.qty {
        background: #333;
        color: #e0e0e0;
    }
    
    .quantity input.qty:focus {
        background: #3a3a3a;
    }
}
