/* Galerías por servicio: botón en cada tarjeta, panel con videos + fotos, y visor de foto grande */
.svc { align-items: flex-start; }
.svc-btn { margin-top: auto; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); background: transparent; border: 1px solid var(--gold); border-radius: 4px; padding: 10px 16px; cursor: pointer; }
.svc-btn:hover { background: var(--gold); color: #0A0A0A; }
.svc p { margin-bottom: 8px; }

.gal { position: fixed; inset: var(--hdr, 0px) 0 0 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.gal-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.gal-bar h2 { font-size: clamp(22px, 5vw, 30px); }
.gal-x, .lb-x { font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); background: transparent; border: 1px solid var(--gold); border-radius: 4px; padding: 8px 14px; cursor: pointer; }
.gal-body { padding-block: 24px 48px; display: flex; flex-direction: column; gap: 32px; }
.gal-sub { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 12px; }

.gal-videos { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 860px) { .gal-videos { grid-template-columns: repeat(3, 1fr); } }
.yt { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--gold); border-radius: 4px; overflow: hidden; background: #000; }
.yt button { all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; cursor: pointer; position: relative; }
.yt img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yt .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 10, 10, 0.25); }
.yt .play span { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: #0A0A0A; display: flex; align-items: center; justify-content: center; font-size: 26px; padding-left: 5px; }
.yt button:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gal-grid { columns: 2; column-gap: 10px; }
@media (min-width: 720px) { .gal-grid { columns: 3; } }
@media (min-width: 1000px) { .gal-grid { columns: 4; } }
.gal-grid button { all: unset; box-sizing: border-box; display: block; width: 100%; margin: 0 0 10px; break-inside: avoid; cursor: zoom-in; border: 1px solid var(--gold); border-radius: 4px; overflow: hidden; background: var(--panel); }
.gal-grid button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.gal-grid img { display: block; width: 100%; height: auto; }
.gal-cta { display: flex; justify-content: center; }

.lb { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.96); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; padding: calc(56px + env(safe-area-inset-top, 0px)) 0 calc(56px + env(safe-area-inset-bottom, 0px)); user-select: none; -webkit-user-drag: none; }
.lb-x { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; background: rgba(10, 10, 10, 0.7); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font: inherit; font-size: 34px; line-height: 1; color: var(--gold); background: rgba(10, 10, 10, 0.6); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; padding: 0; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-count { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; }

.gal-more { margin-top: 14px; font-size: 15px; }
.gal-more a { color: var(--gold); font-weight: 600; }

.svc-title { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; transition: text-decoration-color .2s; }
.svc-title:hover, .svc-title:focus-visible { text-decoration-color: var(--gold); }
.fig-btn { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; position: relative; }
.fig-btn:hover img { filter: brightness(1.08); }
.fig-go { display: block; margin-top: 4px; color: var(--gold); font-size: 11px; }

/* Portafolio: tarjetas uniformes y centradas */
#portafolio .gallery { columns: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
#portafolio .gallery figure { margin: 0; aspect-ratio: 4 / 5; break-inside: auto; }
#portafolio .gallery figure > img, #portafolio .gallery .fig-btn { width: 100%; height: 100%; }
#portafolio .gallery img { height: 100%; object-fit: cover; }
#portafolio .gallery figure:nth-child(5) { grid-column: 1 / -1; width: calc(50% - 6px); justify-self: center; }
@media (min-width: 720px) {
  #portafolio .gallery { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  #portafolio .gallery figure { grid-column: span 2; }
  #portafolio .gallery figure:nth-child(4) { grid-column: 2 / span 2; }
  #portafolio .gallery figure:nth-child(5) { grid-column: 4 / span 2; width: auto; justify-self: stretch; }
}

/* Menú de arriba visible con la galería abierta */
html.gal-open header.top { position: fixed; top: 0; left: 0; right: 0; z-index: 55; }
html.gal-open body { padding-top: var(--hdr, 0px); }
@media (min-width: 720px) { main section[id], main [id="cotizacion"] { scroll-margin-top: 90px; } }
