/* ═══════════════════════════════════════════════════════════════════════════
   Service gallery — the PDP photo header for every service (tour, car, space,
   boat). One DOM, seven compositions picked by the theme option
   `service_details.gallery_style`; the style only changes CSS, so a service
   with three photos degrades the same way in all of them.

   The seven mirror the Turie references:
     1 editorial hero + support        5 wide card carousel
     2 panoramic card carousel         6 focused slider
     3 hero + 2x2 mosaic               7 slider + side thumbnails
     4 symmetric 3/6/3 mosaic

   Under 768px every style collapses to the same swipeable single-image
   slider — a mosaic on a phone is four postage stamps.
   ═══════════════════════════════════════════════════════════════════════════ */

.bc-svcg {
    --svcg-gap: 8px;
    --svcg-radius: 12px;
    --svcg-max: 1120px;
    /* Altura común de las siete composiciones. Va como height, no como
       aspect-ratio + max-height: con esa combinación el navegador achica el
       ancho para conservar la proporción y la galería queda angosta. */
    --svcg-h: min(440px, 46vw);
    position: relative;
    margin: 0 auto 16px;
    /* Mismo ancho y mismo padding lateral que el .container del contenido, para
       que el borde de la galería caiga en la misma línea que la sección de abajo. */
    padding: 0 16px;
    max-width: var(--svcg-max);
}

.bc-svcg-inner {
    position: relative;
}

.bc-svcg-track {
    position: relative;
    display: grid;
    gap: var(--svcg-gap);
    border-radius: var(--svcg-radius);
    overflow: hidden;
}

.bc-svcg-item {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #f1f1f1;
    cursor: zoom-in;
}

.bc-svcg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.bc-svcg-item:hover img {
    transform: scale(1.04);
}

.bc-svcg-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .18);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.bc-svcg-item:hover::after {
    opacity: 1;
}

/* ── Show all photos ──────────────────────────────────────────────────── */
.bc-svcg-all {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(17, 24, 39, .16);
    border-radius: 10px;
    background: #fff;
    color: #131416;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.bc-svcg-all:hover {
    border-color: #131416;
}

/* ── Video badge ──────────────────────────────────────────────────────── */
.bc-svcg-video {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(19, 20, 22, .78);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* ── Arrows (carousel and slider styles only) ─────────────────────────── */
.bc-svcg-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: none;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #131416;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .18);
}

.bc-svcg-arrow:hover {
    background: #131416;
    color: #fff;
}

.bc-svcg-prev { left: 10px; }
.bc-svcg-next { right: 10px; }

/* ── Side thumbnails (style 7) ────────────────────────────────────────── */
.bc-svcg-thumbs {
    display: none;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.bc-svcg-thumb {
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    opacity: .55;
    transition: opacity .25s;
}

.bc-svcg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bc-svcg-thumb.is-active,
.bc-svcg-thumb:hover {
    opacity: 1;
}

/* ═══ 01 — Editorial: hero + supporting images ═══════════════════════════ */
.bc-svcg--turie_1 .bc-svcg-track {
    grid-template-columns: 1.7fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: var(--svcg-h);
    gap: 10px;
}

.bc-svcg--turie_1 .bc-svcg-item { border-radius: 14px; }
.bc-svcg--turie_1 .bc-svcg-item:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.bc-svcg--turie_1 .bc-svcg-item:nth-child(n+4) { display: none; }

/* ═══ 02 — Panoramic card carousel ═══════════════════════════════════════ */
/* ═══ 05 — Full-width card carousel ══════════════════════════════════════ */
.bc-svcg--turie_2,
.bc-svcg--turie_5 {
    max-width: none;
    padding: 0;
}

.bc-svcg--turie_2 .bc-svcg-track,
.bc-svcg--turie_5 .bc-svcg-track {
    display: flex;
    gap: 12px;
    padding: 0 18px;
    border-radius: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.bc-svcg--turie_2 .bc-svcg-track::-webkit-scrollbar,
.bc-svcg--turie_5 .bc-svcg-track::-webkit-scrollbar { display: none; }

.bc-svcg--turie_2 .bc-svcg-item,
.bc-svcg--turie_5 .bc-svcg-item {
    flex: 0 0 min(31vw, 340px);
    height: 275px;
    border-radius: 28px;
    scroll-snap-align: center;
}

.bc-svcg--turie_5 .bc-svcg-track { gap: 12px; }

.bc-svcg--turie_5 .bc-svcg-item {
    flex-basis: min(34vw, 380px);
    height: 285px;
    border-radius: 10px;
}

.bc-svcg--turie_2 .bc-svcg-arrow,
.bc-svcg--turie_5 .bc-svcg-arrow { display: flex; }

.bc-svcg--turie_2 .bc-svcg-all,
.bc-svcg--turie_5 .bc-svcg-all { right: 28px; }

/* ═══ 03 — Large image + 2 x 2 mosaic ════════════════════════════════════ */
.bc-svcg--turie_3 .bc-svcg-track {
    grid-template-columns: 1.55fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: var(--svcg-h);
    gap: 8px;
}

.bc-svcg--turie_3 .bc-svcg-item:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.bc-svcg--turie_3 .bc-svcg-item:nth-child(n+6) { display: none; }

/* ═══ 04 — Vertical editorial mosaic (3 / 6 / 3) ═════════════════════════ */
.bc-svcg--turie_4 .bc-svcg-track {
    grid-template-columns: .72fr 1.45fr .72fr;
    grid-template-rows: 1fr 1fr;
    height: var(--svcg-h);
    gap: 10px;
}

.bc-svcg--turie_4 .bc-svcg-item { border-radius: 12px; }
.bc-svcg--turie_4 .bc-svcg-item:nth-child(1) { grid-column: 2; grid-row: 1 / 3; }
.bc-svcg--turie_4 .bc-svcg-item:nth-child(2) { grid-column: 1; grid-row: 1; }
.bc-svcg--turie_4 .bc-svcg-item:nth-child(3) { grid-column: 1; grid-row: 2; }
.bc-svcg--turie_4 .bc-svcg-item:nth-child(4) { grid-column: 3; grid-row: 1 / 3; }
.bc-svcg--turie_4 .bc-svcg-item:nth-child(n+5) { display: none; }

/* ═══ 06 — Focused slider ════════════════════════════════════════════════ */
.bc-svcg--turie_6 .bc-svcg-track {
    display: flex;
    gap: 0;
    border-radius: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.bc-svcg--turie_6 .bc-svcg-track::-webkit-scrollbar { display: none; }

.bc-svcg--turie_6 .bc-svcg-track { height: var(--svcg-h); }

.bc-svcg--turie_6 .bc-svcg-item {
    flex: 0 0 100%;
    height: 100%;
    border-radius: 18px;
    scroll-snap-align: center;
}

.bc-svcg--turie_6 .bc-svcg-arrow { display: flex; }

/* ═══ 07 — Large slider + side thumbnails ════════════════════════════════ */
/* The grid goes on the section, not on .bc-svcg-inner: the thumbnail strip is
   a sibling of that div, so a grid there left the strip stacked underneath at
   full width. */
.bc-svcg--turie_7 {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px;
}

.bc-svcg--turie_7 .bc-svcg-inner { min-width: 0; }

.bc-svcg--turie_7 .bc-svcg-track {
    display: flex;
    gap: 0;
    height: var(--svcg-h);
    border-radius: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.bc-svcg--turie_7 .bc-svcg-track::-webkit-scrollbar { display: none; }

.bc-svcg--turie_7 .bc-svcg-item {
    flex: 0 0 100%;
    height: 100%;
    border-radius: 14px;
    scroll-snap-align: center;
}

.bc-svcg--turie_7 .bc-svcg-arrow { display: flex; }
/* La tira acompaña la altura del slider, pero cada miniatura queda a un cuarto:
   con dos fotos antes salían dos losas altísimas. */
.bc-svcg--turie_7 .bc-svcg-thumbs { display: flex; }
.bc-svcg--turie_7 .bc-svcg-thumb {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc((100% - 24px) / 4);
}

/* ═══ Lightbox ═══════════════════════════════════════════════════════════ */
.bc-svcg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(9, 10, 12, .93);
}

.bc-svcg-lightbox.is-open { display: flex; }

.bc-svcg-lightbox img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
}

.bc-svcg-lightbox button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bc-svcg-lightbox button:hover { background: rgba(255, 255, 255, .28); }
.bc-svcg-lb-prev { left: 3vw; }
.bc-svcg-lb-next { right: 3vw; }
.bc-svcg-lb-close { top: 3vh; right: 3vw; }

.bc-svcg-lb-count {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
}

/* ═══ Tablet ═════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .bc-svcg--turie_7 { grid-template-columns: 1fr 92px; }
    .bc-svcg { --svcg-h: min(340px, 44vw); }
}

/* ═══ Phone — every style becomes the same swipeable slider ══════════════ */
@media (max-width: 767px) {
    .bc-svcg {
        display: block !important;
        max-width: none;
        padding: 0;
        margin-bottom: 18px;
    }

    .bc-svcg .bc-svcg-inner {
        display: block;
    }

    .bc-svcg .bc-svcg-track {
        display: flex !important;
        grid-template-columns: none;
        aspect-ratio: auto;
        gap: 0;
        height: auto;
        max-height: none;
        padding: 0;
        border-radius: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }

    .bc-svcg .bc-svcg-track::-webkit-scrollbar { display: none; }

    .bc-svcg .bc-svcg-item {
        display: block !important;
        flex: 0 0 100% !important;
        width: 100%;
        height: 62vw !important;
        max-height: 330px;
        border-radius: 0 !important;
        scroll-snap-align: center;
    }

    .bc-svcg .bc-svcg-arrow { display: none !important; }
    .bc-svcg .bc-svcg-thumbs { display: none !important; }

    .bc-svcg-all {
        right: 12px;
        bottom: 12px;
        padding: 6px 11px;
        font-size: 12px;
    }
}
