/**
 * HOFER Media – Add To Cart Styler 1.0.9
 * Basis-Klasse: .hm-add-to-cart
 * Optional: .hm-title = Icon + Buttontext
 * Optional: .hm-large = größere Mengensteuerung und größerer Button
 */

.hm-add-to-cart form.cart:not(.variations_form):not(.grouped_form),
.hm-add-to-cart .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Mengenfeld: Pfeil | Zahl | Pfeil */
.hm-add-to-cart .quantity.hm-qty-enhanced {
    position: relative;
    display: inline-grid !important;
    grid-template-columns: 20px 26px 20px;
    grid-template-rows: 26px;
    align-items: center;
    justify-items: stretch;
    flex: 0 0 auto;
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.hm-add-to-cart .quantity.hm-qty-enhanced input.qty,
.hm-add-to-cart .quantity.hm-qty-enhanced .qty {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 2;
    display: block !important;
    align-self: center;
    justify-self: center;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-indent: 0 !important;
    text-transform: none !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    appearance: textfield !important;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
    font-variant-numeric: tabular-nums;
    opacity: 1 !important;
}

.hm-add-to-cart .quantity.hm-qty-enhanced .qty::-webkit-inner-spin-button,
.hm-add-to-cart .quantity.hm-qty-enhanced .qty::-webkit-outer-spin-button {
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.hm-add-to-cart .hm-qty-control {
    position: relative;
    z-index: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit;
    cursor: pointer;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

.hm-add-to-cart .hm-qty-decrease { grid-column: 1; grid-row: 1; }
.hm-add-to-cart .hm-qty-increase { grid-column: 3; grid-row: 1; }

.hm-add-to-cart .hm-qty-control::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-style: solid;
    border-color: currentColor;
    border-width: 0 0 1.5px 1.5px;
}
.hm-add-to-cart .hm-qty-decrease::before { transform: rotate(45deg); margin-left: 2px; }
.hm-add-to-cart .hm-qty-increase::before { transform: rotate(225deg); margin-right: 2px; }
.hm-add-to-cart .hm-qty-control:hover { background: rgba(0, 0, 0, 0.05) !important; }
.hm-add-to-cart .hm-qty-control:disabled { opacity: 0.35; cursor: not-allowed; }

.hm-add-to-cart .hm-qty-control:focus-visible,
.hm-add-to-cart .hm-atc-styled:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* Gemeinsame Button-Basis */
.hm-add-to-cart .hm-atc-styled {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    box-sizing: border-box;
    line-height: 1 !important;
    text-indent: 0 !important;
    overflow: hidden;
}

/* Standard: nur Warenkorb-Icon */
.hm-add-to-cart .hm-atc-styled.hm-atc-icon-only {
    flex-basis: 28px;
    width: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    font-size: 0 !important;
}

.hm-add-to-cart .hm-atc-icon-only > *:not(.hm-atc-cart-icon) {
    display: none !important;
}

/* Optional .hm-title: Icon und vorhandenen Buttontext anzeigen. */
.hm-add-to-cart.hm-title .hm-atc-styled.hm-atc-with-title {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 10px !important;
    gap: 6px;
    font-size: inherit !important;
    white-space: nowrap;
}

.hm-add-to-cart.hm-title .hm-atc-styled.hm-atc-with-title > .hm-atc-title {
    display: inline !important;
    font-size: inherit !important;
    line-height: 1.2 !important;
}

/* Fremde Icons aus Theme/Elementor weiterhin ausblenden; eigenes Icon bleibt. */
.hm-add-to-cart.hm-title .hm-atc-styled.hm-atc-with-title > *:not(.hm-atc-title):not(.hm-atc-cart-icon) {
    display: none !important;
}

.hm-add-to-cart .hm-atc-cart-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: initial !important;
    line-height: 1 !important;
    pointer-events: none;
}

.hm-add-to-cart .hm-atc-cart-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: none;
}

.hm-add-to-cart .single_add_to_cart_button.disabled,
.hm-add-to-cart .single_add_to_cart_button:disabled,
.hm-add-to-cart button[name="add-to-cart"]:disabled {
    cursor: not-allowed;
}

/* Farben: Grundzustand und Hover vor dem Hinzufügen. */
.hm-add-to-cart .hm-atc-styled {
    background-color: #c3a5a4 !important;
    color: #ffffff !important;
}

.hm-add-to-cart .hm-atc-styled:hover,
.hm-add-to-cart .hm-atc-styled:focus {
    background-color: #3f5a81 !important;
    color: #ffffff !important;
}

/*
 * Sobald das Produkt im Warenkorb liegt, bleibt der Warenkorb-Button bewusst
 * in seiner rosa Grundfarbe – auch bei weiterhin aktivem Hover/Focus nach dem Klick.
 */
.hm-add-to-cart .hm-atc-styled.hm-atc-in-cart,
.hm-add-to-cart .hm-atc-styled.hm-atc-in-cart:hover,
.hm-add-to-cart .hm-atc-styled.hm-atc-in-cart:focus,
.hm-add-to-cart .hm-atc-styled.added,
.hm-add-to-cart .hm-atc-styled.added:hover,
.hm-add-to-cart .hm-atc-styled.added:focus {
    background-color: #c3a5a4 !important;
    color: #ffffff !important;
}

/* Grauer Status-Haken als eigenes Element rechts AUSSERHALB des Buttons. */
.hm-add-to-cart .hm-atc-status-check {
    display: none !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0 0 0 2px !important;
    padding: 0 !important;
    color: #9a9a9a !important;
    font-size: initial !important;
    line-height: 1 !important;
    pointer-events: none;
}

.hm-add-to-cart .hm-atc-status-check.hm-atc-status-check-visible {
    display: inline-flex !important;
}

.hm-add-to-cart .hm-atc-status-check svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor !important;
    stroke: none;
}

/* WooCommerce/Themes dürfen keinen eigenen Added-Haken zusätzlich einblenden. */
.hm-add-to-cart .hm-atc-styled.added::after {
    display: none !important;
    content: none !important;
}

/*
 * Optional .hm-large
 * Mengenfeld und Add-to-Cart-Button werden merklich, aber nicht übermäßig größer.
 */
.hm-add-to-cart.hm-large .quantity.hm-qty-enhanced {
    grid-template-columns: 25px 34px 25px;
    grid-template-rows: 34px;
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

.hm-add-to-cart.hm-large .quantity.hm-qty-enhanced input.qty,
.hm-add-to-cart.hm-large .quantity.hm-qty-enhanced .qty {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    font-size: 14px !important;
    line-height: 34px !important;
}

.hm-add-to-cart.hm-large .hm-qty-control {
    width: 25px !important;
    min-width: 25px !important;
    max-width: 25px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
}

.hm-add-to-cart.hm-large .hm-qty-control::before {
    width: 7px;
    height: 7px;
}

.hm-add-to-cart.hm-large .hm-atc-styled {
    min-height: 36px !important;
    height: 36px !important;
}

.hm-add-to-cart.hm-large .hm-atc-styled.hm-atc-icon-only {
    flex-basis: 36px;
    width: 36px !important;
    min-width: 36px !important;
}

.hm-add-to-cart.hm-large.hm-title .hm-atc-styled.hm-atc-with-title {
    padding-left: 13px !important;
    padding-right: 13px !important;
    gap: 7px;
}

.hm-add-to-cart.hm-large .hm-atc-cart-icon {
    width: 17px;
    height: 17px;
}

.hm-add-to-cart.hm-large .hm-atc-status-check {
    width: 22px;
    height: 22px;
    margin-left: 3px !important;
}
