/* =====================================================================
   G Digital Ally v1.0 — services.css (solo servicios.html)
   Categorías en cuadrícula 3×2 · tarjetas breves · ficha en modal flotante
   con UNA imagen por servicio. No usar carrusel horizontal de categorías.
   ===================================================================== */

.services-hero{background:radial-gradient(circle at 75% 20%,rgba(15,171,213,.18),transparent 35%),linear-gradient(120deg,#071b2d,#10365b)}

.service-explorer{background:#f8fbfd}
.service-explorer-head{display:grid;grid-template-columns:1.15fr .85fr;gap:48px;align-items:end;margin-bottom:36px}
.service-explorer-head h2{font-size:clamp(1.95rem,3.4vw,3.15rem);max-width:740px;letter-spacing:-.046em;margin-bottom:0}
.service-explorer-head>p{margin:0 0 9px;max-width:420px;line-height:1.75}

/* ---------- Categorías: 3 × 2 ---------- */
.category-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:0 0 22px;padding:0;list-style:none}
.category-pill{width:100%;height:100%;min-height:112px;border-radius:18px;border:1px solid #d6e5ef;background:#fff;text-align:left;padding:19px 20px;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;column-gap:13px;row-gap:8px;align-content:start;line-height:1.26;color:#183d55;transition:transform .2s,box-shadow .2s,border-color .2s,background-color .2s}
.category-pill-number{grid-column:1;grid-row:1;font-size:.7rem;font-weight:850;letter-spacing:.15em;color:#0f7aa6}
.category-pill-title{grid-column:1;grid-row:2;font-size:clamp(.88rem,1.15vw,1rem);font-weight:750;hyphens:auto;overflow-wrap:anywhere}
.category-pill-count{grid-column:1;grid-row:3;font-size:.74rem;color:#5d7587;font-weight:600;margin-top:2px}
.category-pill-arrow{grid-column:2;grid-row:1/4;align-self:center;font-size:1.25rem;color:#1588bb;line-height:1;transition:transform .2s}
.category-pill:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(13,72,112,.1);border-color:#7fcbea}
.category-pill:hover .category-pill-arrow{transform:translate(2px,-2px)}
.category-pill[aria-pressed="true"]{background:linear-gradient(130deg,#0c3554,#115a7e);border-color:#115a7e;box-shadow:0 14px 25px rgba(8,67,99,.15);color:#fff}
.category-pill[aria-pressed="true"] .category-pill-number,.category-pill[aria-pressed="true"] .category-pill-arrow{color:#68dcf7}
.category-pill[aria-pressed="true"] .category-pill-count{color:#b8d6e8}

/* ---------- Buscador ---------- */
.catalog-tools{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;margin-bottom:26px}
.detail-search{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #c9dce9;border-radius:13px;padding:0 8px 0 16px;width:min(100%,460px);height:50px}
.detail-search .icon{width:19px;height:19px;color:#3d86ab}
.detail-search input{border:0;outline:none;flex:1;min-width:0;background:transparent;font-size:.95rem;color:#132e45;height:100%}
.detail-search input::-webkit-search-cancel-button{display:none}
.detail-search:focus-within{border-color:#1aa4e7;box-shadow:0 0 0 3px #dff5ff}
.search-clear{border:0;background:#eef6fb;color:#2b6b8d;border-radius:9px;font-size:.78rem;font-weight:700;padding:7px 10px}
.search-clear:hover{background:#dff0fa}

/* ---------- Presentación de la categoría ---------- */
.category-feature{display:grid;grid-template-columns:minmax(250px,42%) 1fr;min-height:290px;background:#fff;border:1px solid #e0edf3;border-radius:25px;overflow:hidden;box-shadow:0 14px 40px rgba(20,76,104,.07)}
.category-feature-image{margin:0;position:relative;overflow:hidden;background:linear-gradient(130deg,#113c5a,#087ca9) center/cover no-repeat;min-height:260px}
.category-feature-image img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.photo-credit{position:absolute;bottom:14px;left:14px;z-index:1;background:rgba(5,24,39,.7);color:#fff;font-size:.7rem;border-radius:25px;padding:5px 10px}
.category-feature-copy{padding:40px clamp(24px,4.5vw,64px);display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.category-feature-copy h2{font-size:clamp(1.75rem,3vw,2.7rem);margin-bottom:13px;letter-spacing:-.05em;max-width:670px}
.category-feature-copy p{font-size:1.02rem;line-height:1.7;max-width:590px;margin-bottom:0}
.category-feature-copy .category-hint{font-size:.82rem;font-weight:700;color:#0f72a6;margin-top:14px}

/* ---------- Tarjetas ---------- */
.catalog-count{margin:30px 0 16px;color:#506878;font-size:.86rem;font-weight:650}
.detail-service-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;list-style:none;margin:0;padding:0}
.service-detail-card{height:100%;font-family:inherit;text-align:left;display:flex;flex-direction:column;gap:9px;padding:26px 24px 23px;border-radius:18px;border:1px solid #dce8f0;background:#fff;color:#19354c;min-height:222px;width:100%;transition:transform .23s,border-color .23s,box-shadow .23s}
.service-detail-card:hover{border-color:#4fc2e8;box-shadow:0 16px 37px rgba(8,65,105,.105);transform:translateY(-4px)}
.service-card-top{display:flex;justify-content:space-between;align-items:center;color:#2f7899}
.service-code{font-size:.77rem;font-weight:800;letter-spacing:.11em}
.service-icon-arrow{font-size:1.3rem;font-weight:500}
.service-category-label{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:#4f7489;font-weight:700}
.service-name{display:block;font-weight:760;font-size:1.13rem;line-height:1.25;letter-spacing:-.016em}
.service-card-desc{margin:0;font-size:.9rem;line-height:1.6;color:#566e80;flex:1}
.service-card-cta{font-size:.83rem;font-weight:800;color:var(--blue-600);margin-top:8px}
.catalog-more-wrap{text-align:center;margin-top:24px}
.catalog-more{font-weight:700;font-size:.9rem;background:#fff;border:1px solid #a4ccdd;border-radius:100px;padding:12px 22px;color:#105c82}
.catalog-more:hover{background:#e4f4fb}
.empty-state{text-align:center;padding:44px 20px;color:var(--muted);background:#fff;border:1px dashed #c9dce9;border-radius:18px}
.empty-state p{margin:0 auto 16px;max-width:520px}

.service-last-cta{background:linear-gradient(120deg,#082138,#0c3f63);padding:clamp(64px,8vw,80px) 0;color:#fff}
.service-last-cta .container{display:flex;gap:40px;justify-content:space-between;align-items:center}
.service-last-cta h2{font-size:clamp(1.9rem,3.3vw,3.05rem);margin-bottom:12px}
.service-last-cta p{color:#bed8e7;max-width:640px;margin:0}
.service-last-cta .btn{flex-shrink:0}

/* =====================================================================
   Ficha modal flotante (dialog nativo)
   ===================================================================== */
html.modal-open,html.modal-open body{overflow:hidden}
.service-modal{position:fixed;inset:0;margin:auto;padding:0;border:1px solid rgba(206,230,241,.85);border-radius:22px;width:min(1060px,calc(100vw - 40px));max-width:none;height:fit-content;max-height:min(90dvh,940px);overflow:hidden;color:#153a53;background:#fff;box-shadow:0 32px 110px rgba(0,10,24,.48)}
.service-modal[open]{display:flex;flex-direction:column;animation:modal-enter .26s ease both}
.service-modal::backdrop{background:rgba(2,15,32,.76);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
@keyframes modal-enter{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:none}}

.modal-head{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px 18px 14px 28px;border-bottom:1px solid #e3eef5;background:#f3f9fd;flex-shrink:0}
.modal-head .eyebrow{margin:0;font-size:.68rem;color:#1d6489;line-height:1.4}
.modal-close{display:inline-flex;gap:8px;align-items:center;justify-content:center;padding:9px 16px;border:1px solid #c9e4f0;border-radius:99px;background:#fff;color:#0f5f86;font-size:.84rem;font-weight:750;flex-shrink:0;min-height:42px}
.modal-close:hover{background:#e6f5fc}
.modal-close .icon{width:16px;height:16px}

.modal-scroll{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0}
.modal-layout{display:grid;grid-template-columns:minmax(260px,.82fr) minmax(0,1.18fr)}
.modal-visual{position:relative;background:#103958;min-height:100%}
.modal-photo{position:sticky;top:0;height:calc(min(90dvh,940px) - 70px);min-height:420px;overflow:hidden;margin:0}
.modal-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:opacity .25s}
.modal-photo img.is-loading{opacity:0}
.modal-photo figcaption{position:absolute;bottom:16px;left:16px;padding:6px 11px;color:#fff;background:rgba(7,27,45,.78);border-radius:50px;font-size:.72rem}

.modal-content{padding:34px clamp(24px,4vw,54px) 34px;min-width:0}
.modal-kicker{text-transform:uppercase;color:#0e6f9a;font-size:.72rem;letter-spacing:.14em;font-weight:750;margin:0 0 12px}
.modal-content h2{font-size:clamp(1.75rem,3vw,2.6rem);line-height:1.08;letter-spacing:-.047em;margin:0 0 13px;color:#092d47}
.modal-content h2:focus{outline:none}
.modal-lead{font-size:1.13rem;font-weight:650;color:#0f6f99;line-height:1.5;margin:0 0 24px}
.modal-content h3{font-size:1.08rem;color:#123852;margin:24px 0 9px}
.modal-body{color:#47657a;line-height:1.75;margin:0}
.modal-content ul{padding:0 0 0 22px;color:#3a5f76;line-height:1.7;margin:0}
.modal-content li{margin-bottom:6px}
.modal-content li::marker{color:#1597c9}
.modal-notes{display:grid;gap:14px;margin-top:26px}
.modal-notes>div{background:#f1f9fc;border-radius:12px;padding:15px 17px;border-left:3px solid #0da4d2}
.modal-notes>div:last-child{border-left-color:#8bb4c8;background:#f7fafc}
.modal-notes h3{font-size:.88rem;margin:0;color:#21455a;letter-spacing:0}
.modal-notes p{margin:5px 0 0;line-height:1.55;color:#4f6d80;font-size:.88rem}

.modal-bottom{display:flex;gap:16px 24px;align-items:center;justify-content:space-between;padding:26px 32px;background:linear-gradient(100deg,#092940,#0e4668);color:#fff}
.modal-bottom strong{font-size:1.1rem;color:#fff}
.modal-bottom p{margin:5px 0 0;color:#bedbe9;max-width:430px;line-height:1.55;font-size:.88rem}
.modal-actions{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:10px}
.modal-actions .btn{white-space:nowrap}
.modal-link{font-size:.82rem;color:#c6f5ff;background:transparent;border:0;padding:9px;text-decoration:underline;text-underline-offset:3px}
.modal-link:hover{color:#fff}

/* ---------- Responsive ---------- */
@media (max-width:960px){
  .service-explorer-head{grid-template-columns:1fr;gap:10px}
  .service-explorer-head>p{max-width:690px}
  .detail-service-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .category-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .modal-layout{grid-template-columns:1fr}
  .modal-photo{position:relative;height:280px;min-height:0}
  .modal-bottom{flex-direction:column;align-items:flex-start}
  .modal-actions{justify-content:flex-start}
}
@media (max-width:670px){
  .category-feature{grid-template-columns:1fr}
  .category-feature-image{min-height:200px;height:200px}
  .category-feature-copy{padding:26px 22px 30px}
  .detail-service-grid{grid-template-columns:1fr}
  .service-detail-card{min-height:0}
  .service-last-cta .container{flex-direction:column;align-items:flex-start}
}
@media (max-width:600px){
  .category-nav{gap:10px}
  .category-pill{min-height:118px;padding:15px 13px;border-radius:15px}
  .category-pill-title{font-size:.86rem;line-height:1.22}
  .category-pill-arrow{font-size:1rem}
  .service-modal{width:100vw;max-height:100dvh;height:100dvh;border:0;border-radius:0}
  .modal-head{padding:10px 12px 10px 18px}
  .modal-head .eyebrow{font-size:.6rem;letter-spacing:.12em}
  .modal-photo{height:220px}
  .modal-content{padding:26px 20px 30px}
  .modal-bottom{padding:24px 20px calc(28px + env(safe-area-inset-bottom))}
  .modal-actions{flex-direction:column;align-items:stretch;width:100%}
  .modal-actions .btn{width:100%}
}
@media (max-width:360px){
  .category-nav{grid-template-columns:1fr}
  .category-pill{min-height:0}
}
@media (prefers-reduced-motion:reduce){
  .service-modal[open]{animation:none}
  .category-pill:hover,.service-detail-card:hover{transform:none}
}
