/**
 * Bezpieczna Przesyłka — style frontu.
 *
 * Kolorystyka dopasowana do motywu kubiczduo: niebieski #0969b3 (przyciski,
 * zakładki), tekst #4a4a49, tło zakładek #f1f1f1, bez zaokrągleń.
 */

.bp-tab,
.bp-info,
.bp-lightbox {
    --bp-blue: #0969b3;
    --bp-blue-dark: #07548f;
    --bp-text: #4a4a49;
    --bp-dark: #060707;
    --bp-muted: #898989;
    --bp-bg: #f1f1f1;
    --bp-bg-hover: #e6eef6;
}

/* ------------------------------------------------------------------
 * Pasek zakładek motywu
 *
 * kubiczduo: .tabs .nav-tabs { display: grid; grid-template-columns: repeat(3, 1fr) }
 * — czwarta zakładka spadałaby do drugiego rzędu. Przy 4+ zakładkach:
 * desktop — jeden rząd, szerokość wg treści; telefon — siatka 2 × 2.
 * Przeglądarki bez :has() zostają przy układzie motywu.
 * ------------------------------------------------------------------ */

@media (min-width: 768px) {
    .tabs .nav-tabs:has(> .nav-item:nth-child(4)) {
        grid-template-columns: none;
        grid-auto-columns: auto;
        grid-auto-flow: column;
    }
}

@media (max-width: 767px) {
    .tabs .nav-tabs:has(> .nav-item:nth-child(4)) {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Nazwy jedno- i dwuwierszowe w jednym rzędzie — wyśrodkowane w pionie. */
    .tabs .nav-tabs:has(> .nav-item:nth-child(4)) > .nav-item {
        display: flex;
    }

    .tabs .nav-tabs:has(> .nav-item:nth-child(4)) > .nav-item > .nav-link {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: center;
        height: auto;
    }
}

/* ------------------------------------------------------------------
 * Zakładka
 * ------------------------------------------------------------------ */

.bp-tab {
    padding: 10px 0 4px;
    color: var(--bp-text);
    font-size: 15px;
    line-height: 1.6;
}

.bp-tab__head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.bp-tab__icon {
    display: flex;
    flex: 0 0 64px;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    color: var(--bp-blue);
}

.bp-tab__icon svg {
    width: 44px;
    height: 44px;
}

.bp-tab__intro {
    flex: 1 1 auto;
    min-width: 0;
}

.bp-tab__heading {
    margin: 0 0 8px;
    color: var(--bp-dark);
    font-size: 20px;
    font-weight: 600;
}

.bp-tab__text p:last-child {
    margin-bottom: 0;
}

.bp-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.bp-points__item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 14px;
    background: #fff;
    color: var(--bp-dark);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.bp-points__check {
    display: flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bp-blue);
    color: #fff;
}

.bp-tab__product-text {
    margin-top: 20px;
    padding: 14px 16px;
    border-left: 3px solid var(--bp-blue);
    background: #fff;
}

.bp-tab__title {
    margin: 28px 0 12px;
    color: var(--bp-dark);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.bp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.bp-gallery__item {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #fff;
    cursor: zoom-in;
}

.bp-gallery__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bp-gallery__zoom {
    display: flex;
    position: absolute;
    right: 8px;
    bottom: 8px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--bp-blue);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bp-gallery__item:hover .bp-gallery__img,
.bp-gallery__item:focus .bp-gallery__img {
    transform: scale(1.04);
}

.bp-gallery__item:hover .bp-gallery__zoom,
.bp-gallery__item:focus .bp-gallery__zoom {
    opacity: 1;
}

.bp-tab__more {
    margin: 20px 0 0;
}

.bp-tab__more a {
    color: var(--bp-blue);
    font-weight: 600;
}

.bp-tab__more a:hover,
.bp-tab__more a:focus {
    color: var(--bp-blue-dark);
    text-decoration: underline;
}

/* Tryb JS bez zakładek w motywie — zwykła sekcja */
.bp-tab-holder--standalone {
    margin: 30px 0;
    padding: 20px 15px;
    background: var(--bp-bg, #f1f1f1);
}

@media (max-width: 575px) {
    .bp-tab__head {
        gap: 12px;
    }

    .bp-tab__icon {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }

    .bp-tab__icon svg {
        width: 34px;
        height: 34px;
    }

    .bp-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .bp-gallery__zoom {
        opacity: 1;
    }
}

/* ------------------------------------------------------------------
 * Informacja w prawej kolumnie
 * ------------------------------------------------------------------ */

.bp-info {
    clear: both;
    margin: 16px 0;
}

/* Prawa kolumna (#est-product-right) ma tło #f1f1f1 — blok jako biała karta. */
.bp-info__main {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--bp-blue);
    background: #fff;
    color: var(--bp-text);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

a.bp-info__main:hover,
a.bp-info__main:focus {
    background: var(--bp-bg-hover);
    color: var(--bp-text);
    text-decoration: none;
}

.bp-info__icon {
    display: flex;
    flex: 0 0 42px;
    color: var(--bp-blue);
}

.bp-info__icon svg {
    width: 42px;
    height: 42px;
}

.bp-info__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.bp-info__title {
    color: var(--bp-dark);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.2s ease;
}

a.bp-info__main:hover .bp-info__title,
a.bp-info__main:focus .bp-info__title {
    color: var(--bp-blue);
}

.bp-info__text {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.4;
}

.bp-info__arrow {
    display: flex;
    flex: 0 0 auto;
    color: var(--bp-blue);
    transition: transform 0.2s ease;
}

a.bp-info__main:hover .bp-info__arrow,
a.bp-info__main:focus .bp-info__arrow {
    transform: translateX(3px);
}

.bp-info__photos {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: var(--bp-blue);
    font-size: 13px;
    font-weight: 500;
}

.bp-info__photos:hover,
.bp-info__photos:focus {
    color: var(--bp-blue-dark);
    text-decoration: underline;
}

/* ------------------------------------------------------------------
 * Lightbox galerii
 * ------------------------------------------------------------------ */

body.bp-no-scroll {
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.bp-lightbox {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.bp-lightbox.is-open {
    display: flex;
}

.bp-lightbox__img {
    display: block;
    max-width: calc(100vw - 140px);
    max-height: calc(100vh - 100px);
    -webkit-user-select: none;
    user-select: none;
}

.bp-lightbox__btn {
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bp-lightbox__btn:hover,
.bp-lightbox__btn:focus {
    background: var(--bp-blue);
    outline: none;
}

.bp-lightbox__close {
    top: 14px;
    right: 14px;
}

.bp-lightbox__prev {
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
}

.bp-lightbox__next {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

.bp-lightbox.is-single .bp-lightbox__prev,
.bp-lightbox.is-single .bp-lightbox__next,
.bp-lightbox.is-single .bp-lightbox__counter {
    display: none;
}

.bp-lightbox__counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    letter-spacing: 0.04em;
}

@media (max-width: 767px) {
    .bp-lightbox__img {
        max-width: 100vw;
        max-height: calc(100vh - 140px);
    }

    .bp-lightbox__prev,
    .bp-lightbox__next {
        top: auto;
        bottom: 8px;
        transform: none;
    }

    .bp-lightbox__counter {
        bottom: 22px;
    }
}
