/*!
Theme Name: Ivax
Theme URI: https://sztosit.eu
Template: Divi
Version: 1.0.7
Description: Child theme styles for Ivax (zoptymalizowane).
Author: SztosIT.eu Przemysław Kozłowski
Author URI: https://sztosit.eu
*/

/* ================== ZMIENNE ================== */
:root {
    --clr-bg: #262626; /* tło sekcji „dostawa” */
    --clr-card: #3d3d3d; /* grafitowe karty */
    --clr-accent: #ff8c00; /* pomarańczowy akcent */
    --clr-text: #efefef; /* jasny tekst */
    --radius: 12px;
    --shadow: 0 12px 28px rgba(0, 0, 0, .5);
    --transition: all .25s ease;

    /* Callbox */
    --callbox-bg: #22272e;
    --callbox-br: #374151;
    --callbox-text: #e6e9ef;
    --callbox-muted: #9aa3b2;
}

/* ================== BLOK CEN ================== */
.fancy-pricing {
    font-family: inherit;
    color: var(--clr-text);
}

.price-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

@media (max-width: 767.98px) {
    .price-selector {
        gap: 5px;
    }
}

.price-option {
    position: relative;
    overflow: hidden;
    flex: 1 1 0;
    text-align: center;
    padding: 1.25rem .75rem;
    border-radius: var(--radius);
    border: 1px solid #4b4b4b;
    background: linear-gradient(180deg, #3d3d3d, #2c2c2c);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.price-option::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--clr-accent), #ffc557);
}

.price-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
}

.price-option svg {
    display: block;
    margin: 0 auto .75rem;
    width: 44px;
    height: 44px;
    fill: var(--clr-accent);
}

.price-option .label {
    font-weight: 600;
    margin-bottom: .25rem;
    color: #d7d7d7;
    letter-spacing: .25px;
}

.price-option .amount {
    font-weight: 700;
    color: var(--clr-text);
    font-size: 1.22rem;
}

@media (min-width: 768px) {
    .price-option .amount {
        font-size: 1.28rem;
    }
}

.price-option .amount s, .price-option .amount del {
    opacity: .3;
}

/* ================== PODSUMOWANIE DOSTAWY ================== */
.delivery-summary {
    background: #1f1f1f;
    border: 2px solid var(--clr-accent);
    border-radius: var(--radius);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
    padding: 1.1rem;
    margin-top: 12px;
    margin-bottom: 14px;
}

@media (max-width: 767.98px) {
    .delivery-summary {
        padding: .65rem;
    }
}

.delivery-summary .ribbon {
    text-align: center;
    font-weight: 700;
    color: var(--clr-accent);
    margin-bottom: .8rem;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.delivery-summary .info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    color: #bdbdbd;
    font-size: .95rem;
    margin-bottom: .7rem;
}

.delivery-summary .info .pc-inline {
    display: grid;
    gap: 6px;
}

.delivery-summary .info .pc-inline .label {
    font-size: .8rem;
    color: #b8b8b8;
}

.delivery-summary .info input.postcode-input {
    height: 35px;
	font-size: 15px;
    padding: 0 .8rem;
    border-radius: 10px;
    border: 1px solid var(--clr-accent);
    background: #2a2a2a;
    color: var(--clr-text);
    outline: none;
    transition: box-shadow .2s ease, border-color .2s ease;
    width: 125px;
}

.delivery-summary .info input.postcode-input:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, .25);
}

.delivery-summary .info .ship {
    margin-left: auto;
    display: grid;
    gap: 3px;
    text-align: right;
    color: var(--clr-accent);
}

.delivery-summary .title {
    margin-top: 2rem;
    font-weight: 800;
    color: var(--clr-text);
    font-size: 1.05rem;
    text-align: center;
}

.delivery-summary .title .amount {
    color: var(--clr-accent);
    font-size: 1.35rem;
}

@media (max-width: 480px) {
    .delivery-summary .title .amount {
        display: block;
    }
}

/* ================== STAN ŁADOWANIA ================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: .3;
}

.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .8);
}

.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 4px solid transparent;
    border-top-color: var(--clr-accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* ================== STEPPER ILOŚCI (GLOBAL) ================== */
.ivax-qty, .qty-stepper {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #4b4b4b;
}

.ivax-qty .btn-minus, .ivax-qty .btn-plus,
.qty-stepper .btn-minus, .qty-stepper .btn-plus {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: #3a3a3a;
    color: var(--clr-text);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: transform .05s ease, background .2s ease;
}

.ivax-qty .btn-minus:hover, .ivax-qty .btn-plus:hover,
.qty-stepper .btn-minus:hover, .qty-stepper .btn-plus:hover {
    background: #444;
}

.ivax-qty .btn-minus:active, .ivax-qty .btn-plus:active,
.qty-stepper .btn-minus:active, .qty-stepper .btn-plus:active {
    transform: scale(.96);
}

.ivax-qty input.qty, .qty-stepper input.qty {
    width: 46px;
    text-align: center;
    border: 0;
    background: transparent;
    color: var(--clr-text);
    font-weight: 700;
    font-size: .95rem;
    pointer-events: none; /* blok wpisywania */
}

/* ukrycie natywnych spinnerów */
.single-product input[type=number].qty::-webkit-outer-spin-button,
.single-product input[type=number].qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
}

.single-product input[type=number].qty {
    -moz-appearance: textfield !important;
}

/* feedback przy próbie przekroczenia limitu */
@keyframes ivax-shake {
    0% {
        transform: translateX(0)
    }
    25% {
        transform: translateX(-2px)
    }
    50% {
        transform: translateX(2px)
    }
    75% {
        transform: translateX(-2px)
    }
    100% {
        transform: translateX(0)
    }
}

.ivax-limit-hit {
    animation: ivax-shake .25s linear;
}

/* ================== LAYOUT PRZYCISKU NA PRODUKCIE ================== */
.single-product form.cart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 10px;
}

.single-product form.cart .single_add_to_cart_button {
    padding: .75rem 1.25rem;
    border-radius: 8px;
}

.single-product form.cart .single_add_to_cart_button:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

@media (max-width: 480px) {
    .single-product form.cart {
        grid-auto-flow: row;
        grid-auto-columns: unset;
        grid-template-columns:1fr;
        gap: 10px;
    }

    .single-product form.cart .single_add_to_cart_button {
        width: 100%;
    }
}

/* === Mniejszy stepper – tylko na stronie produktu === */
.single-product .ivax-qty,
.single-product .qty-stepper {
    padding: 2px;
    gap: 3px;
    border-radius: 8px;
}

.single-product .ivax-qty .btn-minus,
.single-product .ivax-qty .btn-plus,
.single-product .qty-stepper .btn-minus,
.single-product .qty-stepper .btn-plus {
    width: 35px;
    height: 100%;
    font-size: 14px;
    border-radius: 7px;
}

.single-product .ivax-qty input.qty,
.single-product .qty-stepper input.qty {
    width: 40px !important;
    font-size: .90rem !important;
    font-weight: 700;
    background: #2a2a2a !important;
    color: white !important;
}

/* ================== BOX KONTAKTOWY ================== */
.ivax-callbox {
    margin-top: 14px;
    background: var(--callbox-bg);
    border: 1px solid var(--callbox-br);
    color: var(--callbox-text);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns:1fr auto;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.ivax-callbox__label {
    font-size: .95rem;
    font-weight: 600;
    opacity: .95;
}

.ivax-callbox__right {
    text-align: right;
    display: grid;
    gap: 2px;
}

.ivax-callbox__phone {
    color: var(--clr-accent);
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
}

.ivax-callbox__phone:hover {
    text-decoration: underline;
}

.ivax-callbox__hours {
    color: var(--callbox-muted);
    font-size: .9rem;
}

@media (max-width: 480px) {
    .ivax-callbox {
        grid-template-columns:1fr;
        text-align: left;
    }

    .ivax-callbox__right {
        text-align: left;
    }
}

/* — Callbox w formularzu (gdy osadzony w <form> przez hook) + nadpiski na Divi — */
.single-product form.cart .ivax-callbox {
    grid-column: 1 / -1; /* nowy wiersz pod przyciskiem */
    justify-self: stretch;
    width: 100%;
    margin-top: 12px;
    display: block;
}

.single-product .ivax-callbox,
.single-product .ivax-callbox *,
.single-product .ivax-callbox .ivax-callbox__hours {
    color: var(--callbox-text) !important;
}

.single-product .ivax-callbox {
    background: var(--callbox-bg) !important;
    border: 1px solid var(--callbox-br) !important;
}

.single-product .ivax-callbox .ivax-callbox__phone {
    color: var(--clr-accent) !important;
}

#calc_shipping_country_field, #calc_shipping_city_field {
    display: none !important
}

/* =================== KOSZYK =================== */
button[name="update_cart"] {
    float: right !important
}

a.ivax-add-more-products {
    margin-right: 15px !important;
    background-color: #eee !important;
    border: none !important;
    padding: 10px 30px !important;
    font-size: 18px !important;
}

/* ================== ILOŚCI PRODUKTU ================ */
/* Wspólny badge (jeśli już masz, zostaw – poniższe nadpisze co trzeba) */
.stock.ivax-stock-badge {
    padding: 4px 20px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.25;
    font-size: .92rem;
    border: 1px solid transparent;
    text-align: center;
}

/* 6+ (zielony) – spokojny */
.stock.ivax-stock--many {
    color: #22c55e;
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .35);
}

/* 2–5 (amber) – mocniejsze wyróżnienie */
.stock.ivax-stock--low {
    color: #f59e0b;
    background: rgba(245, 158, 11, .16);
    border-color: rgba(245, 158, 11, .45);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, .35);
    animation: ivax-pulse 2s ease-out infinite;
}

/* 1 (czerwony) – najbardziej alarmowy */
.stock.ivax-stock--critical {
    color: #ef4444;
    background: rgba(239, 68, 68, .16);
    border-color: rgba(239, 68, 68, .5);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .35);
    animation: ivax-pulse 1.6s ease-out infinite;
}

/* Delikatny puls „oddychania” */
@keyframes ivax-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7)
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 0, 0, 0)
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0)
    }
}

/** **/
/* Dobierz produkty – kolory z palety motywu */
.woocommerce-cart .actions .ivax-add-more-products{
    /* bazujemy na zmiennych motywu; są fallbacki, gdyby ich nie było */
    --accent: var(--clr-accent, #ff8c00);
    --text:   var(--clr-text, #efefef);

    /* delikatne tło z akcentu (pastel) + czytelny tekst z akcentu */
    --bg: color-mix(in srgb, var(--accent) 14%, #ffffff 86%);
    --fg: color-mix(in srgb, var(--accent) 65%, #1a1a1a 35%);
    --ring: color-mix(in srgb, var(--accent) 35%, transparent);

    background: var(--callbox-bg) !important;
    color: white !important;
    border:1px solid color-mix(in srgb, var(--accent) 70%, #ffffff 30%);
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease;
}

/* hover = pełny akcent z białym tekstem */
.woocommerce-cart .actions .ivax-add-more-products:hover{
    background: #888 !important;
    color:var(--text) !important;
    border-color: var(--accent);
}

/* Fallback dla przeglądarek bez color-mix (stary Safari/Edge) */
@supports not (color: color-mix(in srgb, #000 50%, #fff 50%)) {
    .woocommerce-cart .actions .ivax-add-more-products{
        background:#fff4e6;            /* pastel z akcentu */
        color:#8a4a00 !important;       /* ciemniejszy odcień akcentu */
        border-color:#ff8c00;
    }
    .woocommerce-cart .actions .ivax-add-more-products:hover{
        background:#ff8c00; color:#fff !important; border-color:#ff8c00;
    }
}

