/**
 * Xblitz – strona produktu: blok ceny i "Dodaj do koszyka".
 * Ładowany tylko na stronie produktu (inc/product-page.php).
 * Szablon: woocommerce/single-product/price.php
 */

.single-product .summary {
    --xb-red: #C41A1B;
    --xb-red-dark: #A01516;
    --xb-ink: #15171F;
    --xb-muted: #5A6070;
    --xb-faint: #A2A9B8;
    --xb-line: #ECEFF5;
    --xb-field: #D5DAE4;
    --xb-soft: #F6F7FA;
    --xb-green: #1E8E4E;
}

/* ---------- karta ---------- */
.single-product .summary .price-cart {
    display: block !important;
    margin: 18px 0 24px !important;
    padding: 22px 22px 18px;
    background: #fff;
    border: 1px solid var(--xb-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 20, 38, .04), 0 10px 26px -16px rgba(16, 20, 38, .18);
}

/* ---------- cena ---------- */
.single-product .summary .price-cart .price-box {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 18px;
}

.single-product .summary .price-cart .price-box > p:empty {
    display: none;
}

.single-product .summary .price-cart p.price {
    order: 1;
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    margin: 0 !important;
    line-height: 1.1;
}

.single-product .summary .price-cart p.price .amount {
    font-family: "Poppins SemiBold", sans-serif;
    font-weight: 600;
    font-size: 34px;
    line-height: 1.1;
    color: var(--xb-ink);
}

.single-product .summary .price-cart p.price ins {
    order: 0;
    text-decoration: none !important;
    background: none;
}

.single-product .summary .price-cart p.price ins .amount {
    color: var(--xb-red);
}

.single-product .summary .price-cart p.price del {
    order: 1;
    opacity: 1 !important;
    font-family: "Poppins Regular", sans-serif;
    font-size: 19px;
    line-height: 1.1;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: var(--xb-faint);
}

.single-product .summary .price-cart p.price del .amount {
    font-family: inherit;
    font-weight: 400;
    font-size: inherit;
    color: inherit;
}

.xb-sale-badge {
    order: 2;
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--xb-red);
    color: #fff;
    font-family: "Poppins SemiBold", sans-serif;
    font-size: 14px;
    line-height: 1;
    letter-spacing: .01em;
}

.xb-save {
    order: 3;
    flex-basis: 100%;
    font-family: "Poppins Medium", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--xb-green);
}

.xb-save .amount {
    font-family: "Poppins SemiBold", sans-serif;
    color: inherit;
}

/* najniższa cena z 30 dni (wtyczka WC Price History) */
.single-product .summary .price-cart .wc-price-history.prior-price {
    order: 4;
    flex-basis: 100%;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    font-family: "Poppins Regular", sans-serif;
    font-size: 12.5px !important;
    line-height: 1.5;
    color: var(--xb-muted) !important;
}

.single-product .summary .price-cart .wc-price-history .amount,
.single-product .summary .price-cart .wc-price-history bdi {
    font-family: "Poppins Medium", sans-serif;
    font-size: inherit !important;
    color: inherit !important;
}

.single-product .summary .price-cart p.stock {
    order: 5;
    flex-basis: 100%;
    margin: 0 !important;
    font-size: 13px;
}

/* ---------- ilość + przycisk ---------- */
.single-product .summary .price-cart .add-to-cart-button {
    margin: 0 !important;
}

.single-product .summary .price-cart form.cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    margin: 0 !important;
}

.single-product .summary .price-cart form.cart::before,
.single-product .summary .price-cart form.cart::after {
    display: none !important;
}

.single-product .summary .price-cart .quantity {
    display: inline-flex !important;
    align-items: stretch;
    flex: none;
    height: 54px;
    margin: 0 !important;
    float: none !important;
    border: 1px solid var(--xb-field);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.single-product .summary .price-cart .quantity .plus-minut-button {
    display: contents !important;
}

.single-product .summary .price-cart .quantity .qty {
    order: 1;
    width: 48px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    text-align: center;
    font-family: "Poppins SemiBold", sans-serif;
    font-size: 16px !important;
    color: var(--xb-ink);
    -moz-appearance: textfield;
}

.single-product .summary .price-cart .quantity .qty:focus {
    outline: none;
}

.single-product .summary .price-cart .quantity .qty::-webkit-outer-spin-button,
.single-product .summary .price-cart .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.single-product .summary .price-cart .quantity .qty_button {
    width: 42px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: var(--xb-ink) !important;
    display: grid !important;
    place-items: center;
    cursor: pointer;
    font-size: 0 !important;
    line-height: 1;
    transition: background .15s, color .15s;
}

.single-product .summary .price-cart .quantity .qty_button:hover {
    background: var(--xb-soft) !important;
    color: var(--xb-red) !important;
}

.single-product .summary .price-cart .quantity .qty_button i {
    display: none !important;
}

.single-product .summary .price-cart .quantity .qty_button.minus {
    order: 0;
}

.single-product .summary .price-cart .quantity .qty_button.plus {
    order: 2;
}

.single-product .summary .price-cart .quantity .qty_button.minus::before {
    content: "−";
    font-size: 21px;
}

.single-product .summary .price-cart .quantity .qty_button.plus::before {
    content: "+";
    font-size: 20px;
}

.single-product .summary .price-cart .single_add_to_cart_button {
    flex: 1 1 220px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    float: none !important;
    background: var(--xb-red) !important;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-family: "Poppins SemiBold", sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 10px 22px -12px rgba(196, 26, 27, .7);
    transition: background .15s, transform .15s;
}

.single-product .summary .price-cart .single_add_to_cart_button::before {
    content: "\f07a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 17px;
}

.single-product .summary .price-cart .single_add_to_cart_button:hover {
    background: var(--xb-red-dark) !important;
    transform: translateY(-1px);
}

.single-product .summary .price-cart .single_add_to_cart_button.loading {
    opacity: .7;
}

/* porównanie */
.single-product .summary .price-cart .compare-products-button {
    flex-basis: 100%;
    display: block !important;
    margin: 2px 0 0 !important;
}

.single-product .summary .price-cart .compare-products-button .compare-button {
    margin: 0 !important;
    padding: 0 !important;
}

.single-product .summary .price-cart a.compare {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    padding: 4px 0 !important;
    background: none !important;
    border: 0 !important;
    color: var(--xb-muted) !important;
    font-family: "Poppins Medium", sans-serif !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    text-transform: none;
    text-decoration: none !important;
}

.single-product .summary .price-cart a.compare::before {
    content: "\f362";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
}

.single-product .summary .price-cart a.compare:hover {
    color: var(--xb-red) !important;
}

/* brak w magazynie */
.single-product .summary .price-cart .out-in-stock-info {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--xb-soft);
    color: var(--xb-muted) !important;
    font-family: "Poppins SemiBold", sans-serif;
    font-size: 14px;
}

.single-product .summary .price-cart .out-in-stock-info::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xb-faint);
}

/* ---------- korzyści pod przyciskiem ---------- */
.xb-buy-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--xb-line);
    list-style: none;
}

.xb-buy-perks li {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-family: "Poppins Medium", sans-serif;
    font-size: 13px;
    line-height: 1.3;
    color: var(--xb-ink);
}

.xb-buy-perks .truck-icon,
.xb-buy-perks .shield-icon {
    flex: none;
    width: 18px;
    height: 18px;
    background-color: var(--xb-red) !important;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.xb-buy-perks .truck-icon {
    -webkit-mask-image: url("../img/darmowa-dostawa-xblitz.svg");
}

.xb-buy-perks .shield-icon {
    -webkit-mask-image: url("../img/gwarancja-xblitz.svg");
}

@media (max-width: 600px) {
    .single-product .summary .price-cart {
        padding: 18px 16px 16px;
        border-radius: 16px;
    }

    .single-product .summary .price-cart p.price .amount {
        font-size: 30px;
    }

    .single-product .summary .price-cart .single_add_to_cart_button {
        flex-basis: 160px;
        gap: 8px;
        padding: 0 12px !important;
        font-size: 15px !important;
        white-space: nowrap;
    }

    .single-product .summary .price-cart .quantity .qty_button {
        width: 38px !important;
    }

    .single-product .summary .price-cart .quantity .qty {
        width: 40px !important;
    }
}

/* ================================================================
   GALERIA ZDJĘĆ (wtyczka Product Gallery Slider – slick)
   ================================================================ */

.single-product .woo-product-gallery-slider {
    --xb-red: #C41A1B;
    --xb-ink: #15171F;
    --xb-line: #ECEFF5;
    position: relative;
}

/* główne zdjęcie */
.single-product .woo-product-gallery-slider .wpgs-for {
    position: relative;
    margin: 0 0 12px !important;
    overflow: hidden;
    border: 1px solid var(--xb-line);
    border-radius: 20px;
    background: radial-gradient(120% 120% at 50% 15%, #FFFFFF 0%, #F3F5F9 70%, #ECEFF4 100%);
    box-shadow: 0 1px 2px rgba(16, 20, 38, .04), 0 14px 30px -20px rgba(16, 20, 38, .25);
}

/* tło na slajdzie, nie na karcie: slick przesuwa ścieżkę transformacją,
   a to izoluje mix-blend-mode – zdjęcie musi mieć tło w tej samej warstwie */
.single-product .woo-product-gallery-slider .wpgs-for .slick-slide {
    background: radial-gradient(120% 120% at 50% 15%, #FFFFFF 0%, #F3F5F9 70%, #ECEFF4 100%) !important;
}

.single-product .woo-product-gallery-slider .wpgs-for .slick-slide a {
    background: transparent !important;
}

/* :not(.zoomImg) – powiększenie (imagezoom.js) wstawia drugie <img class="zoomImg">
   w pełnym rozmiarze; nie wolno go zmniejszać do 100% ani dawać mu paddingu */
.single-product .woo-product-gallery-slider .wpgs-for .slick-slide img:not(.zoomImg) {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 7%;
    background: transparent !important;
    mix-blend-mode: multiply; /* białe tło packshotu zlewa się z tłem karty */
    transition: transform .35s ease;
}

.single-product .woo-product-gallery-slider .wpgs-for img.zoomImg {
    padding: 0 !important;
    aspect-ratio: auto !important;
    background: #FFFFFF !important; /* pełne tło – zakrywa zdjęcie pod spodem */
    mix-blend-mode: normal !important;
    cursor: zoom-in;
}

.single-product .woo-product-gallery-slider .wpgs-for .zoomtoo-container {
    background: transparent !important;
}

/* strzałki głównego zdjęcia */
.single-product .woo-product-gallery-slider .wpgs-for .slick-arrow {
    position: absolute !important;
    top: 50% !important;
    z-index: 5;
    width: 44px !important;
    height: 44px !important;
    margin: -22px 0 0 !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 6px 18px -6px rgba(16, 20, 38, .35);
    color: var(--xb-ink) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, background .15s, color .15s, transform .15s;
}

.single-product .woo-product-gallery-slider .wpgs-for .slick-arrow::before {
    content: "" !important;
    display: block;
    width: 10px;
    height: 10px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    font-size: 0 !important;
}

.single-product .woo-product-gallery-slider .wpgs-for .flaticon-back {
    left: 14px !important;
    right: auto !important;
}

.single-product .woo-product-gallery-slider .wpgs-for .flaticon-back::before {
    transform: translateX(2px) rotate(135deg);
}

.single-product .woo-product-gallery-slider .wpgs-for .flaticon-right-arrow {
    right: 14px !important;
    left: auto !important;
}

.single-product .woo-product-gallery-slider .wpgs-for .flaticon-right-arrow::before {
    transform: translateX(-2px) rotate(-45deg);
}

.single-product .woo-product-gallery-slider .wpgs-for:hover .slick-arrow,
.single-product .woo-product-gallery-slider .wpgs-for .slick-arrow:focus-visible {
    opacity: 1;
}

.single-product .woo-product-gallery-slider .wpgs-for .slick-arrow:hover {
    background: var(--xb-red);
    color: #fff !important;
}

@media (hover: none) {
    .single-product .woo-product-gallery-slider .wpgs-for .slick-arrow {
        opacity: 1;
    }
}

/* miniatury */
.single-product .woo-product-gallery-slider .wpgs-nav {
    position: relative;
    margin: 0 -5px !important;
    padding: 0 !important;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-slide {
    padding: 0 5px;
    border: 0 !important;
    background: transparent;
    cursor: pointer;
    outline: none;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-slide img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 8%;
    margin: 0 !important;
    border: 1.5px solid var(--xb-line) !important;
    border-radius: 12px;
    background: transparent !important;
    mix-blend-mode: multiply;
    opacity: .7;
    transition: opacity .2s, border-color .2s;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-slide:hover img {
    opacity: 1;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-current img {
    opacity: 1;
    border-color: var(--xb-red) !important;
}

/* strzałki miniatur */
.single-product .woo-product-gallery-slider .wpgs-nav .slick-arrow {
    position: absolute !important;
    top: 50% !important;
    z-index: 3;
    width: 30px !important;
    height: 30px !important;
    margin-top: -15px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: #fff !important;
    box-shadow: 0 4px 12px -4px rgba(16, 20, 38, .35);
    color: var(--xb-ink) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    display: grid !important;
    place-items: center;
    cursor: pointer;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-arrow::before {
    content: "" !important;
    display: block;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    opacity: 1 !important;
    font-size: 0 !important;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-prev {
    left: -6px !important;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-prev::before {
    transform: translateX(1px) rotate(135deg);
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-next {
    right: -6px !important;
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-next::before {
    transform: translateX(-1px) rotate(-45deg);
}

.single-product .woo-product-gallery-slider .wpgs-nav .slick-arrow:hover {
    background: var(--xb-red) !important;
    color: #fff !important;
}

/* znaczek "Promocja!" – pigułka w lewym górnym rogu zdjęcia zamiast koła */
.single-product div.product > span.onsale {
    top: 16px !important;
    left: 16px !important;
    right: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    background: #C41A1B !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: .02em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px -6px rgba(196, 26, 27, .55);
    z-index: 20 !important;
}

/* lupa (powiększenie) – okrągły przycisk zamiast emoji 🔍 */
.single-product .woo-product-gallery-slider .wpgs-for a.wpgs-lightbox-icon::before {
    content: "" !important;
    top: 14px !important;
    right: 14px !important;
    left: auto !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315171F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 18px no-repeat !important;
    box-shadow: 0 6px 18px -6px rgba(16, 20, 38, .35);
    opacity: 0 !important;
    transition: opacity .2s !important;
}

.single-product .woo-product-gallery-slider .wpgs-for:hover a.wpgs-lightbox-icon::before {
    opacity: 1 !important;
}

@media (hover: none) {
    .single-product .woo-product-gallery-slider .wpgs-for a.wpgs-lightbox-icon::before {
        opacity: 1 !important;
    }
}
