/**
 * Horizontal Add to Cart - Stylesheet
 *
 * This file contains the styles to align the quantity selector
 * and add-to-cart button horizontally.
 */

/* Hide old quantity buttons */
.c-product__quantity-plus,
.c-product__quantity-minus,
.js-quantity-plus,
.js-quantity-minus,
.h-cb.c-product__quantity-plus,
.h-cb.c-product__quantity-minus {
    display: none !important;
}

/*
 * 1. The main wrapper
 */
.ha-atc-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 15px;
    width: 100%;
    margin-top: 15px;
}

/*
 * 2. Quantity selector container
 */
.ha-atc-wrapper .quantity {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: stretch !important;
    position: relative !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: 80px !important;
}

/* Hide default number input spinners */
.ha-atc-wrapper .quantity input[type="number"]::-webkit-outer-spin-button,
.ha-atc-wrapper .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Input styling with important flags to override theme styles */
.ha-atc-wrapper .quantity input[type="number"],
.ha-atc-wrapper .quantity input.c-product__quantity-value {
    -moz-appearance: textfield !important;
    text-align: center !important;
    width: 35px !important;
    padding: 0 2px !important;
    border: none !important;
    background: #fff !important;
    font-size: 13px !important;
    height: 100% !important;
    margin: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 1 !important;
    flex: 1 !important;
    line-height: 1 !important;
}

/* Quantity buttons container */
.ha-qty-buttons {
    display: flex !important;
    flex-direction: column !important;
    border-left: 1px solid #ddd;
    height: 100% !important;
    width: 40px !important;
    order: 2 !important;
}

/* Common styles for quantity buttons */
.ha-qty-up,
.ha-qty-down {
    background: #f7f7f7;
    border: none;
    width: 100% !important;
    height: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s;
    min-height: 0 !important;
    position: relative;
}

.ha-qty-up:hover,
.ha-qty-down:hover {
    background: #e7e7e7;
}

/* Separator between buttons */
.ha-qty-up {
    border-bottom: 1px solid #ddd;
}

/* New Arrow icons */
.ha-qty-up::before,
.ha-qty-down::before {
    content: "";
    width: 8px;
    height: 8px;
    border-style: solid;
    border-width: 2px 2px 0 0;
    border-color: #666;
    transform: rotate(-45deg);
    position: absolute;
    margin-top: 2px;
}

.ha-qty-down::before {
    transform: rotate(135deg);
    margin-top: -2px;
}

/*
 * 3. Add to cart button
 */
.ha-atc-wrapper .single_add_to_cart_button {
    flex: 1 1 auto;
    margin-bottom: 0 !important;
}

/* Override theme styles for quantity input */
@media (max-width: 1189px) {
    .ha-atc-wrapper .quantity input.c-product__quantity-value {
        width: 35px !important;
        order: 1 !important;
    }
}

/*
 * 4. Responsive adjustments
 */
@media (max-width: 768px) {
    .ha-atc-wrapper {
        gap: 10px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .ha-atc-wrapper {
        gap: 8px;
        margin-top: 8px;
    }
}

/* Override theme's max-width restriction on desktop */
@media (min-width: 1190px) {
    .ha-atc-wrapper {
        gap: 0;
    }
    
    .c-product--layout-1 .ha-atc-wrapper .button,
    .c-product--layout-1.product-type-simple .ha-atc-wrapper .button,
    .c-product--layout-2 .ha-atc-wrapper .button,
    .c-product--layout-2.product-type-simple .ha-atc-wrapper .button {
        max-width: none !important;
        width: 100%;
    }
} 