/* ==========================================================================
   SERMAX · Sitio publico
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --brand: #00a9c7;
    --brand-strong: #0c7c91;
    --ink: #14232f;
    --muted: #52606d;
    --line: #e6edf3;
    --teal-band: #0c7c91;
    --footer-bg: #a9dcd7;
    --footer-bar: #7cc2bd;

    /* Ancho maximo de contenido, usado por todos los contenedores. */
    --content-width: min(100% - 96px, 1220px);
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.2;
}

.container {
    width: var(--content-width);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Primitivos reutilizables de layout y tipografia.
   Cambiar aca afecta a todos los bloques con estetica similar.
   -------------------------------------------------------------------------- */

/* Ritmo vertical de una seccion de contenido. */
.section {
    padding: 76px 0;
}

/* Layout de dos columnas (texto + imagen). */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

/* Titulo de seccion sobre fondo claro. */
.section-title {
    font-size: clamp(28px, 3.4vw, 36px);
    margin-bottom: 16px;
}

/* Parrafo de cuerpo. */
.prose {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(4, 16, 31, .82), rgba(6, 31, 57, .58)),
        linear-gradient(135deg, #10243b 0%, #123f64 45%, #0b1f35 100%);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .14);
}

.site-header__inner {
    position: relative;
    width: min(100% - 96px, 1220px);
    min-height: 88px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 28px;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/* Logo subido desde el admin. */
.brand-logo {
    display: block;
    width: auto;
    flex: none;
}

.brand--header .brand-logo {
    height: 46px;
}

.brand--footer .brand-logo {
    height: 54px;
}

/* Placeholder mientras no hay logo cargado (adapta color al contexto). */
.brand-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 20px;
    border: 1px dashed currentColor;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    opacity: .7;
}

.brand--header {
    color: #eef6f7;
}

.brand--footer {
    color: #16333d;
}

.main-nav {
    display: flex;
    justify-content: end;
    gap: 26px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.main-nav a {
    color: rgba(238, 246, 247, .82);
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: #fff;
}

.main-nav a.is-active {
    color: #fff;
    font-weight: 700;
    border-bottom-color: var(--brand);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.diagnosis-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border-radius: 6px;
    color: #fff;
    background: var(--brand);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .02em;
    transition: background .15s;
}

.diagnosis-link:hover {
    background: #009fbb;
}

.header-whatsapp {
    width: 52px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #2fd0e6;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.header-whatsapp:hover {
    background: var(--brand);
    color: #fff;
}

.header-whatsapp svg {
    width: 22px;
    height: 22px;
}

.nav-toggle,
.nav-toggle-label {
    display: none;
}

/* ==========================================================================
   Hero de pagina
   ========================================================================== */

.page-hero {
    width: 100%;
    min-height: 70vh;
    display: grid;
    align-items: center;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(4, 16, 31, .68), rgba(4, 16, 31, .28)),
        linear-gradient(135deg, #10243b 0%, #123f64 55%, #0b1f35 100%);
    background-position: center;
    background-size: cover;
}

.page-hero__content {
    width: var(--content-width);
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, .9);
}

.breadcrumb a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
    opacity: .7;
}

/* Tipografia unica para todos los heroes del sitio. */
.page-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 1.02;
    font-weight: 700;
}

/* ==========================================================================
   Placeholder / imagenes de contenido
   ========================================================================== */

.media {
    display: block;
    width: 100%;
    border-radius: 14px;
}

img.media {
    aspect-ratio: 16 / 11;
    object-fit: cover;
    box-shadow: 0 20px 45px rgba(15, 40, 60, .16);
}

.media--placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    aspect-ratio: 16 / 11;
    border: 1px dashed #b8c6d4;
    color: #8494a5;
    background:
        repeating-linear-gradient(45deg, #eef2f6 0 16px, #e6ecf2 16px 32px);
}

.media--placeholder svg {
    width: 46px;
    height: 46px;
    opacity: .55;
}

.media--placeholder span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ==========================================================================
   Bloque "Por que elegirnos"
   (usa .section para el espaciado; solo aporta el fondo teal)
   ========================================================================== */

.reasons {
    background: var(--teal-band);
    color: #fff;
}

.reasons__title {
    font-size: clamp(26px, 3.2vw, 32px);
    margin-bottom: 36px;
}

.reasons__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.reason-card {
    padding: 30px 28px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(6, 45, 55, .18);
}

.reason-card__icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    color: var(--brand-strong);
}

.reason-card__icon svg {
    width: 42px;
    height: 42px;
}

.reason-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 20px;
    color: var(--ink);
}

.reason-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

/* Variante en linea: icono + titulo juntos (como en la referencia) */
.reason-card--inline .reason-card__icon {
    width: 40px;
    height: 40px;
    margin: 0;
}

.reason-card--inline .reason-card__icon svg {
    width: 34px;
    height: 34px;
}

.reason-card--inline .reason-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.reason-card--inline .reason-card__head h3 {
    margin: 0;
}

/* ==========================================================================
   Bloque "Actitud sustentable" (imagen + intro + checklist)
   (usa .section y .split; solo ajusta columnas y alineacion)
   ========================================================================== */

.sustain__grid {
    grid-template-columns: minmax(0, 480px) 1fr;
    align-items: start;
}

img.media.media--tall,
.media--placeholder.media--tall {
    aspect-ratio: 4 / 5;
}

.check-list {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: grid;
    gap: 22px;
}

.check-list li {
    display: flex;
    gap: 12px;
    align-items: start;
}

.check-list__icon {
    flex: none;
    margin-top: 2px;
    color: var(--brand);
}

.check-list__icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.check-list p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.check-list strong {
    color: var(--ink);
}

/* ==========================================================================
   Grilla de tarjetas de proyectos (Casos de exito)
   ========================================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 40, 60, .12);
}

/* La imagen va a tope con los bordes de la tarjeta. */
.project-card .media {
    border-radius: 0;
    box-shadow: none;
}

.project-card__body {
    padding: 20px 20px 24px;
}

.project-card__title {
    margin: 0;
    font-size: 18px;
    color: var(--ink);
}

.project-card__subtitle {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #8695a1;
}

.project-card__desc {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

/* ==========================================================================
   Boton primario (publico)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 26px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.btn:hover {
    background: var(--brand-strong);
}

.btn--outline {
    background: #fff;
    color: var(--brand-strong);
    border: 1px solid var(--brand);
}

.btn--outline:hover {
    background: var(--brand);
    color: #fff;
}

/* ==========================================================================
   Pagina Servicios: tarjetas con overlay + modal
   ========================================================================== */

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.service-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    background: linear-gradient(135deg, #10243b, #0b1f35);
    font-family: inherit;
}

.service-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gradiente base para legibilidad del titulo. */
.service-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 16, 31, .8), rgba(4, 16, 31, .05) 60%);
}

.service-card__title {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 22px;
    z-index: 3;
    color: #fff;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    line-height: 1.2;
}

/* Overlay de hover: oscurece + lupa. */
.service-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: rgba(4, 16, 31, .55);
    opacity: 0;
    transition: opacity .2s ease;
}

.service-card:hover .service-card__overlay,
.service-card:focus-visible .service-card__overlay {
    opacity: 1;
}

.service-card__lupa {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-strong);
    transform: scale(.85);
    transition: transform .2s ease;
}

.service-card:hover .service-card__lupa {
    transform: scale(1);
}

.service-card__lupa svg {
    width: 30px;
    height: 30px;
}

/* Modal */
.service-modal[hidden] {
    display: none;
}

.service-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.service-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 16, 31, .62);
}

.service-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 960px);
    max-height: 90vh;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(4, 16, 31, .35);
}

.service-modal__media {
    position: relative;
    min-height: 340px;
    background: #eef2f6;
}

.service-modal__media img {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-modal__media.has-image img {
    display: block;
}

.service-modal__media.has-image .service-modal__ph {
    display: none;
}

.service-modal__ph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #8494a5;
    background: repeating-linear-gradient(45deg, #eef2f6 0 16px, #e6ecf2 16px 32px);
}

.service-modal__ph svg {
    width: 54px;
    height: 54px;
    opacity: .55;
}

.service-modal__body {
    display: flex;
    flex-direction: column;
    padding: 38px;
}

.service-modal__body h2 {
    font-size: clamp(22px, 3vw, 28px);
}

.service-modal__body hr {
    margin: 16px 0 22px;
    border: 0;
    border-top: 1px solid var(--line);
}

.service-modal__body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-line;
}

.service-modal__actions {
    margin-top: auto;
    padding-top: 32px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.service-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    text-transform: none;
}

.service-modal__close:hover {
    background: #fff;
}

/* ==========================================================================
   Pagina de Contacto (info + formulario + mapa)
   ========================================================================== */

.contact__grid {
    grid-template-columns: minmax(0, 380px) 1fr;
    align-items: start;
}

.contact__intro {
    margin: 0 0 28px;
    max-width: 380px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.5;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
}

.field {
    display: grid;
    gap: 6px;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    color: var(--muted);
    font-size: 14px;
}

.field-input {
    width: 100%;
    padding: 8px 2px;
    font: inherit;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid #cbd5e1;
    border-radius: 0;
    transition: border-color .15s;
}

.field-input:focus {
    outline: none;
    border-bottom-color: var(--brand);
}

textarea.field-input {
    resize: vertical;
    min-height: 44px;
}

.field-error {
    color: #dc2626;
    font-size: 13px;
}

/* Honeypot: oculto para humanos, visible para bots. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form__foot {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
}

.contact-form__note {
    color: var(--muted);
    font-size: 14px;
}

.form-success,
.form-error {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.form-success {
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.form-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.map-section {
    margin-top: 8px;
}

.map {
    display: block;
    width: 100%;
    height: 440px;
    border: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--footer-bg);
    color: #16333d;
}

.site-footer__main {
    position: relative;
    width: min(100% - 96px, 1220px);
    margin: 0 auto;
    padding: 56px 0 64px;
    display: grid;
    grid-template-columns: 1fr 1.35fr 1.5fr 1.25fr;
    gap: 52px;
}

.footer-section h2 {
    margin-bottom: 22px;
    font-size: 21px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 14px 34px;
}

.footer-links a,
.social-links a {
    text-decoration: none;
    color: #274a53;
}

.footer-links a:hover,
.social-links a:hover {
    color: var(--brand-strong);
}

.newsletter-form {
    width: min(100%, 300px);
    height: 46px;
    display: grid;
    grid-template-columns: 1fr 48px;
    align-items: center;
    border: 1px solid #16333d;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.newsletter-form label {
    height: 100%;
}

.newsletter-form span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.newsletter-form input {
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0 14px;
    font: inherit;
    background: transparent;
    color: var(--ink);
}

.newsletter-form input:focus {
    outline: none;
}

.newsletter-form button {
    height: 100%;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--brand-strong);
    cursor: pointer;
}

.newsletter-form button svg {
    width: 22px;
    height: 22px;
}

.social-title {
    margin-top: 32px !important;
    margin-bottom: 16px !important;
}

.social-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.social-links a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #16333d;
    background: rgba(22, 51, 61, .08);
    transition: background .15s, color .15s;
}

.social-links a:hover {
    background: var(--brand-strong);
    color: #fff;
}

.social-links svg {
    width: 19px;
    height: 19px;
}

/* Lista de datos con icono (compartida entre footer y pagina de Contacto). */
.icon-list {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.icon-list > li {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
}

.icon-list svg {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--brand-strong);
}

.icon-list a {
    display: inline-flex;
    color: var(--brand-strong);
}

.site-footer__bar {
    min-height: 66px;
    padding: 14px max(48px, calc((100% - 1220px) / 2));
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    background: var(--footer-bar);
    font-size: 14px;
    color: #14343c;
}

.site-footer__bar p {
    margin: 0;
}

.floating-whatsapp {
    position: fixed;
    right: 34px;
    bottom: 34px;
    z-index: 30;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #25d366;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
    transition: transform .15s;
}

.floating-whatsapp:hover {
    transform: translateY(-3px);
}

.floating-whatsapp svg {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .split {
        gap: 40px;
    }

    .reasons__grid {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    :root {
        --content-width: min(100% - 32px, 1220px);
    }

    .site-header__inner {
        min-height: 74px;
        grid-template-columns: auto auto;
        justify-content: space-between;
        gap: 16px;
    }

    .brand--header .brand-logo {
        height: 40px;
    }

    .nav-toggle-label {
        display: grid;
        gap: 5px;
        width: 38px;
        cursor: pointer;
    }

    .nav-toggle-label span {
        height: 2px;
        background: #fff;
    }

    .main-nav,
    .header-actions {
        grid-column: 1 / -1;
        display: none;
    }

    .main-nav {
        flex-direction: column;
        gap: 14px;
        padding-top: 8px;
    }

    .main-nav a {
        border-bottom: 0;
    }

    .header-actions {
        flex-wrap: wrap;
        padding-bottom: 18px;
    }

    .nav-toggle:checked ~ .main-nav,
    .nav-toggle:checked ~ .header-actions {
        display: flex;
    }

    .section {
        padding: 48px 0;
    }

    .split {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-modal__dialog {
        grid-template-columns: 1fr;
    }

    .service-modal__media {
        min-height: 220px;
    }

    .service-modal__body {
        padding: 26px;
    }

    .contact-form {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .contact-form__foot {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-form__foot .btn {
        width: 100%;
    }

    .map {
        height: 320px;
    }

    .about__media {
        order: -1;
    }

    img.media.media--tall,
    .media--placeholder.media--tall {
        aspect-ratio: 16 / 11;
    }

    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 42px 0;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 18px 16px;
    }

    .floating-whatsapp {
        right: 18px;
        bottom: 18px;
    }
}
