/**
 * Inn_QuantityControls - Quantity Input Controls Styling
 * Integrates with the existing Andalui design system
 */

/* Quantity Controls Wrapper */
.qty-controls-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #F8F7F4; /* Using @light_grey from variables.less */
    border: 1px solid #ddd;
    border-radius: 0; /* Following design system - no border radius */
    overflow: hidden;
    font-family: 'Onest', sans-serif; /* Using @mainfont from variables.less */
}

/* Quantity Input Field */
.qty-controls-wrapper input {
    border: none !important;
    text-align: center;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 60px;
    -moz-appearance: textfield; /* Remove Firefox number input arrows */
}

/* Remove Chrome number input arrows */
.qty-controls-wrapper input::-webkit-outer-spin-button,
.qty-controls-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Quantity Control Buttons */
.qty-btn {
    background: #F8F7F4; /* Same as wrapper background */
    border: none;
    padding: 11px 15px;
    font-size: 18px;
    font-weight: bold;
    color: #0D1307; /* Using @neutral_color */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Special Elite', cursive; /* Using @headfont for buttons */
    line-height: 1;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e8e7e4; /* Slightly darker on hover */
    color: #000;
}

.qty-btn:active {
    background: #d8d7d4;
    transform: translateY(1px);
}

.qty-btn.disabled,
.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F8F7F4;
    color: #999;
}

.qty-btn.disabled:hover,
.qty-btn:disabled:hover {
    background: #F8F7F4;
    color: #999;
    transform: none;
}

/* Minus Button - Left side */
.qty-minus {
    border-right: 1px solid #ddd;
}

/* Plus Button - Right side */
.qty-plus {
    border-left: 1px solid #ddd;
}

/* Focus state for accessibility */
.qty-controls-wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(13, 19, 7, 0.2); /* Using @neutral_color with opacity */
}

/* Mobile Responsive */
@media only screen and (max-width: 767px) {
    .qty-controls-wrapper {
        width: 100%;
        max-width: 150px;
    }
    
    .qty-controls-wrapper input {
        flex: 1;
        min-width: 50px;
    }
    
    .qty-btn {
        padding: 11px 12px;
        min-width: 35px;
        font-size: 16px;
    }
}

/* Integration with existing form styles */
.inn-formbuilder-form .qty-controls-wrapper {
    width: 100%;
    max-width: 200px;
}

/* Cart page specific styling */
.cart .qty-controls-wrapper {
    margin: 0 auto;
}

/* Product detail page specific styling */
.product-add-form .qty-controls-wrapper {
    margin-bottom: 10px;
}

/* Ensure proper alignment in different contexts */
.field.qty .qty-controls-wrapper {
    display: inline-flex;
    vertical-align: top;
}

/* Bundle product options styling */
.bundle-options .qty-controls-wrapper {
    max-width: 120px;
}

/* Wishlist styling */
.wishlist-index-index .qty-controls-wrapper {
    max-width: 100px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .qty-controls-wrapper {
        border: 2px solid #000;
    }
    
    .qty-btn {
        border-color: #000;
        color: #000;
    }
    
    .qty-minus {
        border-right-color: #000;
    }
    
    .qty-plus {
        border-left-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .qty-btn {
        transition: none;
    }
    
    .qty-btn:active {
        transform: none;
    }
}

/* Button Style Variations */
.qty-style-rounded .qty-btn {
    border-radius: 50%;
    min-width: 35px;
    height: 35px;
}

.qty-style-square .qty-btn {
    border-radius: 0;
}

.qty-style-minimal .qty-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #0D1307;
}

.qty-style-minimal .qty-btn:hover {
    background: #F8F7F4;
}

.qty-style-outline .qty-btn {
    background: transparent;
    border: 2px solid #0D1307;
    color: #0D1307;
}

.qty-style-outline .qty-btn:hover {
    background: #0D1307;
    color: #F8F7F4;
}

/* Button Size Variations */
.qty-size-small .qty-btn {
    padding: 8px 10px;
    font-size: 14px;
    min-width: 30px;
}

.qty-size-small .qty-controls-wrapper input {
    padding: 8px 10px !important;
    min-width: 45px;
    font-size: 14px;
}

.qty-size-large .qty-btn {
    padding: 14px 18px;
    font-size: 20px;
    min-width: 50px;
}

.qty-size-large .qty-controls-wrapper input {
    padding: 14px 15px !important;
    min-width: 70px;
    font-size: 18px;
}

/* Mobile adjustments for sizes */
@media only screen and (max-width: 767px) {
    .qty-size-small .qty-btn {
        padding: 8px 8px;
        min-width: 28px;
        font-size: 13px;
    }
    
    .qty-size-small .qty-controls-wrapper input {
        min-width: 40px;
        font-size: 13px;
    }
    
    .qty-size-large .qty-btn {
        padding: 12px 14px;
        min-width: 40px;
        font-size: 18px;
    }
    
    .qty-size-large .qty-controls-wrapper input {
        min-width: 60px;
        font-size: 16px;
    }
}

/* Print styles */
@media print {
    .qty-btn {
        display: none;
    }
    
    .qty-controls-wrapper {
        border: 1px solid #000;
        background: white;
    }
    
    .qty-controls-wrapper input {
        background: white !important;
    }
}
