/* =============================================================================
   CUBACAMARAS · styles.css
   -----------------------------------------------------------------------------
   ARQUITECTURA (para evitar choques de especificidad):
   1. El orden de precedencia lo define @layer, no la especificidad.
      reset < base < layout < components < sections < responsive
   2. Todo se estiliza con UNA sola clase (BEM: .bloque__elemento--modificador).
      No hay selectores descendientes (.hero p, .cta .wrap, etc.).
   3. Las variantes de botón y de eyebrow cambian variables/propiedades por
      modificador, así :hover y los modificadores no se pisan entre sí.

   ÍNDICE (buscar con Ctrl+F el código entre corchetes):
   [C00] Tokens          [C06] Servicios (service-card)
   [C01] Reset           [C07] Galería + lightbox
   [C02] Base            [C08] Marcas
   [C03] Layout          [C09] Razones
   [C04] Componentes     [C10] CTA / Contacto / Footer
   [C05] Hero / Promo    [C11] Responsive (820px / 540px)
   ============================================================================= */

@layer reset, base, layout, components, sections, responsive;


/* ===== [C01] RESET ======================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, figure, ul, address { margin: 0; }
  ul { padding: 0; list-style: none; }
  address { font-style: normal; }
  img { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; cursor: pointer; }
}


/* ===== [C00] TOKENS + [C02] BASE ========================================== */
@layer base {
  :root {
    --navy: #082b58;
    --blue: #1f65b4;
    --sky: #dceafb;
    --red: #df2b2f;
    --red-dark: #c91f25;
    --ink: #152234;
    --muted: #5d6a7b;
    --line: #dbe4ee;
    --paper: #f5f8fc;
    --white: #fff;
    --on-dark: #b9d7fb;
    --on-navy: #8cbdf4;
    --on-navy-text: #c8d9ee;
    --shadow: 0 20px 55px rgba(7, 38, 77, .13);
    --header-h: 78px;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h); /* los anclas no quedan bajo el header fijo */
  }

  body {
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: var(--white);
  }

  :focus-visible { outline: 3px solid #f4b000; outline-offset: 3px; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
  }
}


/* ===== [C03] LAYOUT ======================================================= */
@layer layout {
  .container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

  .section { padding-block: 92px; }
  .section--alt { background: var(--paper); }
  .section--dark { background: var(--navy); color: #fff; }

  .section-head { max-width: 660px; margin-bottom: 42px; }
  .section-head__text { margin: 0; color: var(--muted); font-size: 1.07rem; }
  .section-head__text--on-dark { color: var(--on-navy-text); }

  .section-title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -.045em;
  }

  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
}


/* ===== [C04] COMPONENTES GENERALES ======================================== */
@layer components {

  /* --- Eyebrow (etiqueta sobre títulos) --- */
  .eyebrow {
    margin: 0 0 .6rem;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
  }
  .eyebrow--on-dark { color: var(--on-dark); }
  .eyebrow--on-navy { color: var(--on-navy); }

  /* --- Botón: las variantes solo cambian variables --- */
  .btn {
    --btn-bg: var(--red);
    --btn-bg-hover: var(--red-dark);
    --btn-color: #fff;
    --btn-border: var(--red);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 50px;
    padding: .65rem 1rem;
    border: 2px solid var(--btn-border);
    border-radius: 8px;
    background: var(--btn-bg);
    color: var(--btn-color);
    font-weight: 800;
    transition: transform .2s, background .2s;
  }
  .btn:hover { background: var(--btn-bg-hover); transform: translateY(-2px); }

  .btn--ghost {
    --btn-bg: transparent;
    --btn-bg-hover: rgba(255, 255, 255, .14);
    --btn-border: rgba(255, 255, 255, .7);
  }
  .btn--light {
    --btn-bg: #fff;
    --btn-bg-hover: var(--sky);
    --btn-color: var(--navy);
    --btn-border: #fff;
  }
  .btn--outline {
    --btn-bg: transparent;
    --btn-bg-hover: var(--sky);
    --btn-color: var(--blue);
    --btn-border: var(--blue);
  }
  .btn--sm { min-height: 41px; font-size: .86rem; }

  /* --- Header y navegación --- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
  }
  .site-nav__brand { flex: none; width: 172px; height: 57px; }
  .site-nav__logo { width: 100%; height: 100%; object-fit: contain; }
  .site-nav__toggle {
    display: none;
    padding: .5rem;
    border: 0;
    background: none;
    color: var(--navy);
    font-weight: 800;
  }
  .site-nav__list {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    color: #465265;
    font-size: .9rem;
    font-weight: 700;
  }
  .site-nav__link:hover { color: var(--blue); }

  /* --- WhatsApp flotante --- */
  .whatsapp-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9;
    display: grid;
    place-items: center;
    width: 59px;
    height: 59px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #20b958;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  }
  .whatsapp-float:hover { transform: scale(1.08); }
}


/* ===== [C05] SECCIONES: HERO + PROMO ====================================== */
@layer sections {

  /* --- Hero --- */
  .hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: 650px;
    overflow: hidden;
    background: var(--navy);
    color: #fff;
  }
  .hero::before { /* velo oscuro sobre la imagen */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(4, 20, 45, .95) 0%, rgba(5, 26, 57, .82) 42%, rgba(5, 26, 57, .2) 100%);
  }
  .hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
  .hero__content { max-width: 665px; padding-block: 65px; }
  .hero__logo { width: min(420px, 100%); height: 150px; margin-bottom: 1.7rem; object-fit: contain; }
  .hero__title {
    margin-bottom: 1.3rem;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: .98;
    letter-spacing: -.06em;
  }
  .hero__text { max-width: 610px; margin-bottom: 2rem; color: #e5edf8; font-size: 1.14rem; }
  .hero__trust {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    width: max-content;
    max-width: 100%;
    margin-top: 2.5rem;
    padding: 1.05rem 1.2rem;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: .87rem;
    box-shadow: var(--shadow);
  }
  .hero__trust-item { display: flex; gap: .5rem; }
  .hero__trust-title { display: block; color: var(--navy); }

  /* --- Promoción --- */
  .promo {
    background: linear-gradient(135deg, #f3f8ff 0%, #fff 64%, #e5f0ff 100%);
    border-block: 1px solid var(--line);
  }
  .promo__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr);
    align-items: center;
    gap: 48px;
  }
  .promo__badge {
    display: inline-block;
    padding: .36rem .65rem;
    border-radius: 5px;
    background: var(--red);
    color: #fff;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .06em;
  }
  .promo__eyebrow { margin-top: 1.2rem; }
  .promo__title {
    margin-block: 1rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.06;
    letter-spacing: -.045em;
  }
  .promo__text { margin-bottom: 1.2rem; color: var(--muted); font-size: 1.05rem; }
  .promo__subtitle { margin-bottom: 0; font-size: 1.15rem; }
  .promo__list { display: grid; gap: .65rem; margin-block: 1.4rem 1.7rem; }
  .promo__item { position: relative; padding-left: 1.5rem; color: var(--ink); }
  .promo__item::before { content: "✓"; position: absolute; left: 0; color: var(--blue); font-weight: 900; }
  .promo__phone { margin-left: .9rem; color: var(--navy); font-weight: 900; }
  .promo__note { margin-top: .9rem; color: var(--muted); font-size: .9rem; }
  .promo__figure {
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .promo__img { width: 100%; height: auto; object-fit: contain; }
}


/* ===== [C06] SERVICIOS ==================================================== */
@layer components {
  .service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

  .service-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
  }
  .service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
  .service-card__media { height: 190px; overflow: hidden; }
  .service-card__img { width: 100%; height: 100%; object-fit: cover; }
  .service-card__body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
  .service-card__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-top: -45px;
    border: 4px solid #fff;
    border-radius: 10px;
    background: var(--sky);
    color: var(--blue);
    font-size: 1.35rem;
  }
  .service-card__title { margin: 17px 0 8px; font-size: 1.32rem; }
  .service-card__text { margin-bottom: 1.35rem; color: var(--muted); }
  .service-card__link { margin-top: auto; color: var(--blue); font-weight: 800; }
  .service-card__link:hover { text-decoration: underline; }
}


/* ===== [C07] GALERÍA + LIGHTBOX =========================================== */
@layer components {
  .gallery {
    display: grid;
    grid-template-columns: 1.2fr .8fr .8fr;
    grid-template-rows: 250px 250px;
    gap: 16px;
  }
  .gallery__item { display: grid; }
  .gallery__item--feature { grid-row: span 2; }

  .gallery__btn {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: #0c274a;
    color: #fff;
    text-align: left;
    cursor: zoom-in;
  }
  .gallery__img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
  .gallery__btn:hover .gallery__img { transform: scale(1.05); }
  .gallery__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 43px 17px 15px;
    background: linear-gradient(transparent, rgba(3, 18, 38, .9));
    font-weight: 800;
  }

  .lightbox {
    max-width: min(920px, 92vw);
    max-height: 90vh;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .lightbox::backdrop { background: rgba(0, 0, 0, .85); }
  .lightbox__box { position: relative; }
  .lightbox__img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
  .lightbox__close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #0d315d;
    font-size: 1.4rem;
  }
}


/* ===== [C08] MARCAS ======================================================= */
@layer components {
  .brand-list { display: flex; flex-wrap: wrap; gap: 12px; }
  .brand-list__item {
    padding: .85rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 7px;
    font-weight: 800;
    letter-spacing: .02em;
  }
}
@layer sections {
  .brands__note { max-width: 715px; margin-top: 28px; color: var(--on-navy-text); }
}


/* ===== [C09] RAZONES ====================================================== */
@layer components {
  .reasons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .reason { padding-block: 20px; border-top: 3px solid var(--blue); }
  .reason__title { margin-bottom: .5rem; font-size: 1.1rem; }
  .reason__text { color: var(--muted); }
}


/* ===== [C10] CTA / CONTACTO / FOOTER ====================================== */
@layer sections {
  /* --- CTA --- */
  .cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(115deg, #0d3d78, #1b67b7);
    color: #fff;
  }
  .cta::before { /* círculo decorativo, detrás del contenido */
    content: "";
    position: absolute;
    top: -100px;
    right: -3%;
    width: 430px;
    height: 430px;
    border: 70px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    pointer-events: none;
  }
  .cta__inner { position: relative; padding-block: 72px; }
  .cta__title {
    max-width: 650px;
    margin: .15rem 0 1rem;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.06;
    letter-spacing: -.045em;
  }
  .cta__text { max-width: 600px; margin-bottom: 1.6rem; color: #d8e9fd; }

  /* --- Contacto --- */
  .contact__grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 70px; }
  .contact__lead { max-width: 510px; color: var(--muted); }

  .contact-card { padding: 30px; border-radius: 14px; background: var(--paper); }
  .contact-card__title { margin-bottom: .4rem; font-size: 1.4rem; }
  .contact-card__subtitle { display: block; color: var(--blue); font-weight: 500; }
  .contact-card__person { color: var(--muted); }
  .contact-card__list { display: grid; gap: 16px; margin-block: 25px; }
  .contact-card__item { display: flex; align-items: flex-start; gap: .75rem; }
  .contact-card__icon { width: 1.4rem; color: var(--blue); font-size: 1.2rem; }
  .contact-card__label { display: block; font-weight: 700; }
  .contact-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }

  /* --- Footer --- */
  .site-footer { padding-block: 32px; background: #061d3a; color: #d2dfef; font-size: .9rem; }
  .site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
  .site-footer__name { display: block; color: #fff; font-size: 1rem; }
  .site-footer__text { margin: 0; }
  .site-footer__link:hover { text-decoration: underline; }
}


/* ===== [C11] RESPONSIVE (siempre al final: gana por capa, no por especificidad) */
@layer responsive {

  @media (max-width: 820px) {
    /* navegación móvil */
    .site-nav__list, .site-nav__cta { display: none; }
    .site-nav__toggle { display: block; }
    .site-nav__link { display: block; padding-block: 10px; }
    .site-nav--open { flex-wrap: wrap; height: auto; min-height: var(--header-h); padding-block: 12px; }
    .site-nav__list--open {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      order: 3;
      gap: 0;
      width: 100%;
      padding-block: 7px;
    }

    .section { padding-block: 68px; }
    .hero { min-height: 620px; }

    .promo__grid { grid-template-columns: 1fr; gap: 30px; }
    .promo__figure { max-width: 620px; }

    .service-grid, .reasons { grid-template-columns: 1fr 1fr; }
    .service-card--tablet-wide { grid-column: span 2; }

    .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 230px 190px 190px; }
    .gallery__item--last { grid-column: span 2; }

    .contact__grid { grid-template-columns: 1fr; gap: 32px; }
  }

  @media (max-width: 540px) {
    .container { width: min(100% - 30px, 1160px); }
    .site-nav__brand { width: 144px; }

    .hero__content { padding-block: 52px; }
    .hero__logo { height: 112px; }
    .hero__title { font-size: 2.55rem; }
    .hero__trust { gap: .9rem; padding: .9rem; font-size: .76rem; }

    .service-grid, .reasons { grid-template-columns: 1fr; }
    .service-card--tablet-wide { grid-column: auto; }

    .gallery { grid-template-rows: 240px 155px 155px; gap: 10px; }
    .gallery__item--feature { grid-row: auto; grid-column: span 2; }
    .gallery__item--last { grid-column: auto; }

    .contact-card { padding: 23px; }

    .site-footer__inner { display: block; }
    .site-footer__text { margin-top: .7rem; }

    .whatsapp-float { right: 16px; bottom: 16px; }
  }
}