/* Ficha de servicio: galería + reseña del servicio */
#serviceDialog{width:min(1180px,calc(100% - 32px));max-height:94vh;max-height:94dvh;border-radius:22px;background:#fff;color:var(--navy)}
#serviceDialog .all-dialog-inner{max-height:94vh;max-height:94dvh;overflow:auto;padding:0 32px 32px}
#serviceDialog .all-dialog-head{position:sticky;top:0;z-index:3;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);margin:0 -32px 24px;padding:22px 32px 18px;border-bottom:1px solid #e4ebf2;align-items:center}
#serviceDialog .all-dialog-head .section-label{margin-bottom:4px}
#serviceDialog .all-dialog-head h2{font-size:clamp(24px,3vw,32px);letter-spacing:-.6px;margin:0}
#serviceDialog .all-close{width:44px;height:44px;transition:background .2s,transform .2s}
#serviceDialog .all-close:hover{background:#dcebfa;transform:rotate(90deg)}

/* Distribución */
#serviceDialog.has-gallery .all-dialog-inner{display:grid;grid-template-columns:minmax(0,1fr) 360px;grid-template-rows:auto 1fr;column-gap:32px}
#serviceDialog.has-gallery .all-dialog-head{grid-column:1/-1}
#serviceDialog #servicePhotos{grid-column:1;grid-row:2;min-width:0}
#serviceDialog.has-gallery .service-info{grid-column:2;grid-row:2;align-self:start;position:sticky;top:96px}
#serviceDialog:not(.has-gallery){width:min(860px,calc(100% - 32px))}
#serviceDialog .service-image-note{display:none}

/* Foto principal con fondo difuminado de la misma imagen */
#serviceDialog .all-feature{position:relative;isolation:isolate;border-radius:16px;background:#0f1d2c;overflow:hidden}
#serviceDialog .all-feature::before{content:"";position:absolute;inset:-40px;z-index:-1;background:var(--bg) center/cover no-repeat;filter:blur(30px) brightness(.42) saturate(1.15)}
#serviceDialog .all-feature img{width:100%;height:58vh;height:58dvh;min-height:300px;max-height:640px;object-fit:contain;background:transparent;filter:drop-shadow(0 10px 30px rgba(0,0,0,.35))}
#serviceDialog .all-feature figcaption{position:absolute;left:14px;bottom:14px;background:rgba(7,22,40,.72);backdrop-filter:blur(6px);color:#f3f7fb;font-size:13px;font-weight:600;padding:8px 14px;border-radius:999px;line-height:1.3;max-width:calc(100% - 28px)}

/* Controles */
#serviceDialog .gallery-toolbar{display:flex;align-items:center;gap:10px;padding:14px 0 12px}
#serviceDialog .gallery-toolbar button{border:1px solid #dce7f2;border-radius:12px;background:#fff;width:42px;height:42px;font-size:20px;color:#0b2d63;cursor:pointer;transition:background .2s,border-color .2s}
#serviceDialog .gallery-toolbar button:hover{background:#eaf3fc;border-color:#bcd6ef}
#serviceDialog #galleryCount{font-size:13px;font-weight:800;color:#53667b;min-width:44px;text-align:center}
#serviceDialog #galleryOriginal{margin-left:auto;color:var(--blue);font-size:13px;font-weight:800;padding:10px 0}
#serviceDialog .all-thumbs{display:flex;gap:10px;overflow-x:auto;padding:4px 4px 8px;margin:0}
#serviceDialog .all-thumb{flex:0 0 76px;width:76px;padding:0;border:2px solid transparent;border-radius:12px;background:#edf2f7;overflow:hidden;opacity:.6;transition:opacity .2s,border-color .2s,transform .2s}
#serviceDialog .all-thumb:hover{opacity:1;transform:translateY(-2px)}
#serviceDialog .all-thumb img{height:76px;width:100%;object-fit:cover;border-radius:0}
#serviceDialog .all-thumb span{display:none}
#serviceDialog .all-thumb[aria-pressed=true]{opacity:1;border-color:var(--blue);box-shadow:0 6px 16px rgba(23,132,232,.25)}
#serviceDialog .all-thumb:focus:not(:focus-visible){outline:none}
#serviceDialog .all-thumb:focus-visible{outline:3px solid var(--orange);outline-offset:2px}

/* Reseña del servicio */
.service-info{display:flex;flex-direction:column;gap:20px}
.si-eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:11px;font-weight:900;letter-spacing:2.4px;text-transform:uppercase;color:var(--blue)}
.si-eyebrow::before{content:"";width:22px;height:3px;border-radius:9px;background:linear-gradient(90deg,var(--orange) 0 33%,var(--green) 33% 66%,var(--blue) 66%)}
#serviceDialog .service-project-copy{font-size:15.5px;line-height:1.7;color:#40566e;margin:-8px 0 0}
.si-h{display:block;margin:0 0 10px;font-size:12px;font-weight:900;letter-spacing:1.6px;text-transform:uppercase;color:#6a7f96}
.si-block{background:#f5f9fd;border:1px solid #e1ebf5;border-radius:16px;padding:18px 18px 16px}
.si-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.si-list li{display:flex;gap:10px;align-items:flex-start;font-size:14.5px;line-height:1.4;font-weight:600;color:#1d3552}
.si-list li::before{content:"";flex:none;width:20px;height:20px;margin-top:-1px;border-radius:50%;background:#dcecfb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231784e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat}
.si-meta{display:grid;gap:18px}
.si-meta p{margin:0;font-size:14.5px;line-height:1.55;color:#40566e}
.si-chips{display:flex;flex-wrap:wrap;gap:8px}
.si-chips span{font-size:12.5px;font-weight:700;color:#0b2d63;background:#fff;border:1px solid #cfe0f1;padding:6px 11px;border-radius:999px}
#serviceDialog .service-photo-pending{margin:0;padding:12px 14px;border:1px dashed #c3d8ee;border-radius:12px;background:#fafcfe;font-size:13px;color:#5d7289}
.si-cta{display:grid;gap:10px}
.si-cta .btn{width:100%;font-size:14.5px}
.si-wa{background:#fff;border-color:#bfe5cd;color:#137a3d}
.si-wa:hover{background:#effaf3}
.si-wa svg{width:19px;height:19px;fill:currentColor}

/* Ficha sin galería: reseña a dos columnas */
#serviceDialog:not(.has-gallery) .service-info{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px 28px}
#serviceDialog:not(.has-gallery) .si-eyebrow,#serviceDialog:not(.has-gallery) .service-project-copy{grid-column:1/-1}
#serviceDialog:not(.has-gallery) .si-block{grid-row:span 2}
#serviceDialog:not(.has-gallery) .si-meta{align-content:start}
#serviceDialog:not(.has-gallery) .service-photo-pending,#serviceDialog:not(.has-gallery) .si-cta{grid-column:1/-1}
#serviceDialog:not(.has-gallery) .si-cta{grid-template-columns:1fr 1fr}

@media(max-width:900px){
 #serviceDialog.has-gallery .all-dialog-inner{grid-template-columns:minmax(0,1fr);grid-template-rows:auto}
 #serviceDialog.has-gallery .service-info{grid-column:1;grid-row:3;position:static;margin-top:20px}
}
@media(max-width:700px){
 #serviceDialog{width:calc(100% - 16px);border-radius:16px}
 #serviceDialog .all-dialog-inner{padding:0 16px 18px}
 #serviceDialog .all-dialog-head{margin:0 -16px 16px;padding:14px 16px 12px}
 #serviceDialog .all-feature img{height:48vh;height:48dvh;min-height:240px}
 #serviceDialog .all-thumb{flex-basis:64px;width:64px}
 #serviceDialog .all-thumb img{height:64px}
 #serviceDialog:not(.has-gallery) .service-info{grid-template-columns:1fr}
 #serviceDialog:not(.has-gallery) .si-block{grid-row:auto}
 #serviceDialog:not(.has-gallery) .si-cta{grid-template-columns:1fr}
}

/* ===== Prueba: galería en mosaico (todas las fotos juntas, sin ampliar) ===== */
#serviceDialog .all-feature,#serviceDialog .gallery-toolbar,#serviceDialog .all-thumbs{display:none!important}
#serviceDialog .mosaic{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:170px;grid-auto-flow:dense;gap:8px;border-radius:16px;overflow:hidden}
#serviceDialog .mosaic-item{position:relative;margin:0;overflow:hidden;background:#e8eef4}
#serviceDialog .mosaic-item img{width:100%;height:100%;object-fit:cover;display:block}
#serviceDialog .mosaic-item figcaption{position:absolute;left:0;right:0;bottom:0;padding:22px 10px 8px;font-size:12px;font-weight:600;line-height:1.3;color:#fff;background:linear-gradient(transparent,rgba(5,20,38,.78))}
/* primera foto destacada 2x2 */
#serviceDialog .mosaic-item:first-child{grid-column:span 2;grid-row:span 2}
/* ajustes según cantidad */
#serviceDialog .mosaic[data-count="1"]{grid-template-columns:1fr;grid-auto-rows:420px}
#serviceDialog .mosaic[data-count="1"] .mosaic-item:first-child{grid-column:auto;grid-row:auto}
#serviceDialog .mosaic[data-count="2"]{grid-template-columns:1fr 1fr;grid-auto-rows:380px}
#serviceDialog .mosaic[data-count="2"] .mosaic-item:first-child{grid-column:auto;grid-row:auto}
#serviceDialog .mosaic[data-count="3"] .mosaic-item:first-child{grid-row:span 2;grid-column:span 2}
#serviceDialog .mosaic[data-count="4"]{grid-template-columns:1fr 1fr;grid-auto-rows:230px}
#serviceDialog .mosaic[data-count="4"] .mosaic-item:first-child{grid-column:auto;grid-row:auto}
#serviceDialog .mosaic[data-count="5"] .mosaic-item:nth-child(4),#serviceDialog .mosaic[data-count="5"] .mosaic-item:nth-child(5){grid-column:span 1}
#serviceDialog .mosaic[data-count="5"]{grid-template-columns:repeat(6,minmax(0,1fr))}
#serviceDialog .mosaic[data-count="5"] .mosaic-item{grid-column:span 2}
#serviceDialog .mosaic[data-count="5"] .mosaic-item:first-child{grid-column:span 4;grid-row:span 2}
#serviceDialog .mosaic[data-count="5"] .mosaic-item:nth-child(4),#serviceDialog .mosaic[data-count="5"] .mosaic-item:nth-child(5){grid-column:span 3}

@media(max-width:700px){
 #serviceDialog .mosaic{grid-template-columns:1fr 1fr;grid-auto-rows:130px;gap:6px}
 #serviceDialog .mosaic .mosaic-item,#serviceDialog .mosaic[data-count] .mosaic-item{grid-column:auto;grid-row:auto}
 #serviceDialog .mosaic .mosaic-item:first-child{grid-column:span 2;grid-row:span 2}
 #serviceDialog .mosaic[data-count="2"] .mosaic-item:first-child{grid-row:auto}
 #serviceDialog .mosaic[data-count="2"]{grid-auto-rows:200px}
 #serviceDialog .mosaic-item figcaption{font-size:11px;padding:16px 8px 6px}
 #serviceDialog .mosaic[data-count="4"] .mosaic-item:last-child,#serviceDialog .mosaic[data-count="6"] .mosaic-item:last-child{grid-column:span 2}
 #serviceDialog .mosaic[data-count="4"]{grid-auto-rows:130px}
}
