/* ==========================================================================
   Dr. Malerbi · Consultorio veterinario
   Dirección visual "Barrio": violeta de marca + amarillo de acento.
   Mobile-first. Sin frameworks.
   ========================================================================== */

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/nunito-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito Sans";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Marca (logo oficial) */
    --violet: #463693;
    --violet-deep: #2c2166;
    --violet-soft: #5a4aa8;
    --violet-hover: #3a2c7d;
    --lilac: #efecf8;
    --lilac-2: #dcd7ee;
    --on-violet: #ffffff;
    --on-violet-soft: #d9d4f0;

    /* Acento cálido */
    --sun: #f2c14e;
    --sun-hover: #f5cd6c;
    --sun-soft: #fbe7b0;

    /* Neutros */
    --paper: #ffffff;
    --cream: #fbf7ee;
    --ink: #1f1b2e;
    --ink-soft: #4b4760;

    --wa: #25d366;

    --font-display: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --gutter: 20px;
    --container: 1200px;
    --header-h: 72px;
    --radius: 20px;
    --radius-lg: 32px;
    --space-section: clamp(4.5rem, 10vw, 7rem);

    color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
figure { margin: 0; }
svg { display: block; }

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--violet);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}
a:hover { color: var(--violet-hover); text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--violet);
    outline-offset: 3px;
    border-radius: 4px;
}

address { font-style: normal; }

:where(ul[role="list"]) { list-style: none; margin: 0; padding: 0; }

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--sun);
    color: var(--violet-deep);
    font-weight: 700;
    border-radius: 999px;
}
.skip-link:focus { top: 12px; }

.label {
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1rem;
    color: var(--violet);
}

.section { padding-block: var(--space-section); }
.section-tight { padding-top: 0; }

.section h2 {
    font-size: clamp(2.2rem, 6.5vw, 3.8rem);
    color: var(--violet-deep);
}

.section-sub {
    margin-top: 0.9rem;
    color: var(--ink-soft);
}

/* ---------- Botones y enlaces ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.6rem 1.6rem;
    border: 0;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn-sun { background: var(--sun); color: var(--violet-deep); }
.btn-sun:hover { background: var(--sun-hover); color: var(--violet-deep); }

.btn-line { background: transparent; color: var(--on-violet); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4); }
.btn-line:hover { color: var(--on-violet); box-shadow: inset 0 0 0 2px var(--on-violet); }

.btn-violet { background: var(--violet); color: var(--on-violet); }
.btn-violet:hover { background: var(--violet-hover); color: var(--on-violet); }

.btn-line-violet { background: transparent; color: var(--violet); box-shadow: inset 0 0 0 2px var(--violet); }
.btn-line-violet:hover { background: var(--lilac); color: var(--violet-hover); }

.btn-small { min-height: 44px; padding: 0.45rem 1.15rem; font-size: 0.975rem; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-display);
    font-weight: 800;
}
.link-arrow::after {
    content: "→";
    margin-left: 0.4em;
    transition: transform 0.15s ease;
}
.link-arrow:hover::after { transform: translateX(3px); }

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
}

@media (max-width: 419px) {
    .actions .btn { flex: 1 1 100%; }
}

.stars { color: var(--sun); letter-spacing: 0.12em; }

a[href^="tel:"] { white-space: nowrap; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--violet);
    color: var(--on-violet);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    padding-block: 10px;
    color: var(--on-violet);
}
.brand:hover { color: var(--on-violet); }
.brand svg { display: block; height: auto; }
.brand-mark { width: 36px; }
.brand-word { width: 138px; }
.site-header :focus-visible { outline-color: var(--sun); }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: -12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--on-violet);
    cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 24px;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.menu-open .nav-toggle-bars { background: transparent; }
.menu-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.menu-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.btn) {
    color: var(--on-violet);
    font-family: var(--font-display);
    font-weight: 700;
    text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--sun); }

@media (max-width: 1099px) {
    .js .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--header-h));
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        padding: 4px var(--gutter) 28px;
        background: var(--violet-deep);
        box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.5);
    }
    .js.menu-open .site-nav { display: block; }

    .site-nav li { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
    .site-nav a:not(.btn) {
        display: flex;
        align-items: center;
        min-height: 54px;
        font-size: 1.2rem;
    }
    .header-cta { margin-top: 22px; width: 100%; }

    .no-js .nav-toggle { display: none; }
    .no-js .header-inner { flex-wrap: wrap; }
    .no-js .site-nav { width: 100%; padding-bottom: 20px; }
}

@media (min-width: 1100px) {
    .nav-toggle { display: none; }
    .site-nav { display: flex; align-items: center; gap: 26px; }
    .site-nav ul { display: flex; gap: 22px; font-size: 0.975rem; }
    .site-nav a:not(.btn) { padding-block: 10px; white-space: nowrap; }
}

@media (min-width: 1100px) and (max-width: 1279px) {
    .site-nav { gap: 20px; }
    .site-nav ul { gap: 16px; }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--violet);
    color: var(--on-violet);
}

.hero-watermark {
    position: absolute;
    right: -90px;
    bottom: -70px;
    width: 440px;
    height: auto;
    opacity: 0.06;
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    gap: 40px;
    padding-top: clamp(2rem, 6vw, 3.5rem);
}

.kicker {
    margin-bottom: 1rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.975rem;
    color: var(--sun);
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 6.4rem);
    line-height: 1;
}

.hero-lead {
    margin-top: 1.5rem;
    max-width: 30ch;
    font-size: clamp(1.25rem, 3.6vw, 1.5rem);
    line-height: 1.45;
    color: var(--on-violet);
}

.hero-sub {
    max-width: 42ch;
    color: var(--on-violet-soft);
}

.hero-photo {
    justify-self: center;
    width: 100%;
    max-width: 440px;
    border-radius: 999px 999px 0 0;
    overflow: hidden;
    background: var(--violet-soft);
}
.hero-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 60% 40%;
}

@media (min-width: 960px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        align-items: end;
        gap: 64px;
    }
    .hero-text { padding-bottom: clamp(4rem, 8vw, 6.5rem); }
    .hero-watermark { width: 560px; right: -110px; bottom: -90px; }
}

.strip {
    background: var(--violet-deep);
    color: var(--on-violet-soft);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.975rem;
}
.strip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    padding-block: 16px;
}
.strip .stars { letter-spacing: 0.08em; }

/* ---------- Marcos ---------- */

.about {
    display: grid;
    gap: 44px;
}

.section h2.statement {
    font-size: clamp(1.5rem, 3.8vw, 2.05rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.012em;
    color: var(--violet-deep);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.75rem;
}
.chip {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--lilac);
    color: var(--violet-deep);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
}
.chip-sun { background: var(--sun-soft); }

.about-text > p { color: var(--ink-soft); max-width: 60ch; }

.h-small {
    margin: 2.5rem 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--violet-deep);
    letter-spacing: -0.01em;
}

.facts { margin: 0; }
.facts > div {
    display: grid;
    gap: 0.1rem;
    padding-block: 0.85rem;
    border-bottom: 1px solid var(--lilac-2);
}
.facts > div:first-child { border-top: 1px solid var(--lilac-2); }
.facts dt {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--violet);
}
.facts dd { margin: 0; }

@media (min-width: 600px) {
    .facts > div { grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; }
}

@media (min-width: 960px) {
    .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 80px; }
}

/* ---------- Áreas de atención ---------- */

.areas {
    margin-top: 2.5rem;
    border-top: 2px solid var(--violet-deep);
}
.areas > li {
    display: grid;
    gap: 0.5rem;
    padding-block: 1.6rem;
    border-bottom: 1px solid var(--lilac-2);
}
.areas h3 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    color: var(--violet-deep);
}
.areas p {
    max-width: 58ch;
    color: var(--ink-soft);
}

@media (min-width: 900px) {
    .areas > li {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 40px;
        align-items: baseline;
    }
}

/* ---------- Medicina integrativa ---------- */

.section-cream { background: var(--cream); }

.intro {
    max-width: 62ch;
    margin-top: 1.25rem;
    font-size: 1.1875rem;
    line-height: 1.6;
}

.cards {
    display: grid;
    gap: 16px;
    margin-top: 2.5rem;
}
.card {
    padding: 1.75rem;
    background: var(--paper);
    border-radius: var(--radius);
}
.card h3 {
    margin-bottom: 0.6rem;
    font-size: 1.35rem;
    color: var(--violet-deep);
}
.card p { color: var(--ink-soft); }

@media (min-width: 900px) {
    .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.inline-cta { margin-top: 1.5rem; }

/* ---------- Consultorio ---------- */

.section-lilac { background: var(--lilac); }

.place {
    display: grid;
    gap: 40px;
}
.place address {
    margin: 1.25rem 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--violet-deep);
}
.place .phone { color: var(--ink-soft); }
.place .phone a { font-weight: 700; display: inline-block; padding-block: 0.3rem; }
.place .actions + p { margin-top: 0.75rem; }


.place-photo {
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.place-photo img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.map {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--paper);
}
.map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.25rem;
    text-align: center;
}
.map-address {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.125rem;
    line-height: 1.3;
    color: var(--violet-deep);
}
.map-address span { font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.map-note { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.no-js .map-note { display: none; }

@media (min-width: 900px) {
    .place {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: 40px 64px;
        align-items: center;
    }
    .place .map { grid-column: 1 / -1; aspect-ratio: auto; height: 220px; }
    .place .map.is-loaded { height: 380px; }
}

/* ---------- Pacientes ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2.5rem;
}
.gallery img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--lilac);
}

@media (min-width: 900px) {
    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        padding-bottom: 48px;
    }
    .gallery .offset { transform: translateY(48px); }
}

/* ---------- Opiniones ---------- */

.section-violet {
    background: var(--violet);
    color: var(--on-violet);
    border-radius: 48px 48px 0 0;
}
.section-violet h2 { color: var(--on-violet); }
.section-violet a:not(.btn) { color: var(--sun); }

.score {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 1.25rem;
}
.score-n {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1;
}
.score-meta { display: grid; color: var(--on-violet-soft); font-size: 0.975rem; line-height: 1.4; }
.score .stars { font-size: 1.2rem; }

.feature {
    margin: 2.5rem 0 0;
    padding: 2rem 1.75rem;
    background: var(--sun);
    color: var(--violet-deep);
    border-radius: var(--radius-lg);
}
.feature p {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.35rem, 3.8vw, 2.1rem);
    line-height: 1.28;
    letter-spacing: -0.015em;
}
.feature footer { margin-top: 1rem; font-weight: 800; }

.reviews {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}
.reviews blockquote {
    height: 100%;
    margin: 0;
    padding: 1.6rem;
    background: rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}
.reviews p { flex: 1; font-size: 1.05rem; line-height: 1.55; }
.reviews footer { margin-top: 1rem; color: var(--on-violet-soft); font-weight: 700; font-size: 0.925rem; }

@media (min-width: 720px) {
    .feature { padding: 3.25rem; }
    .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .reviews { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Contacto + footer ---------- */

.site-footer {
    background: var(--violet-deep);
    color: var(--on-violet-soft);
    padding: var(--space-section) 0 calc(28px + env(safe-area-inset-bottom));
}
.site-footer h2 {
    font-size: clamp(2.2rem, 6.5vw, 3.8rem);
    color: var(--on-violet);
}
.site-footer a { color: var(--on-violet); }
.site-footer a:hover { color: var(--sun); }
.site-footer :focus-visible { outline-color: var(--sun); }

.contact {
    display: grid;
    gap: 36px;
}
.contact-lead {
    margin-top: 1.25rem;
    max-width: 40ch;
    font-size: 1.1875rem;
    line-height: 1.55;
}

.contact-list { margin: 0; }
.contact-list > div {
    display: grid;
    gap: 0.15rem;
    padding-block: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.contact-list > div:first-child { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.contact-list dt {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--sun);
}
.contact-list dd { margin: 0; color: var(--on-violet); font-size: 1.125rem; }
.contact-list dd a { font-weight: 700; display: inline-block; padding-block: 0.2rem; }

@media (min-width: 600px) {
    .contact-list > div { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
}
@media (min-width: 900px) {
    .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    margin-top: clamp(3.5rem, 8vw, 5rem);
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.875rem;
    color: #b3abdf;
}
.footer-bottom p { margin: 0; }
.footer-logo { display: block; width: 150px; height: auto; }
.credit a { color: #d9d4f0; text-decoration-color: rgba(255, 255, 255, 0.35); }

/* ---------- WhatsApp flotante ---------- */

.wa-float {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 60;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wa);
    color: #fff;
    box-shadow: 0 10px 24px -8px rgba(20, 16, 50, 0.45), 0 2px 6px rgba(20, 16, 50, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(20, 16, 50, 0.5), 0 2px 6px rgba(20, 16, 50, 0.2); }
.wa-float:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 50%; }
.menu-open .wa-float { display: none; }

@media (min-width: 900px) {
    .wa-float { width: 64px; height: 64px; right: 28px; bottom: 28px; }
    .wa-float svg { width: 34px; height: 34px; }
}

/* ---------- 404 ---------- */

.page-404 {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    padding-block: 4rem;
    background: var(--violet);
    color: var(--on-violet);
}
.page-404 h1 { font-size: clamp(2.4rem, 8vw, 4rem); margin-bottom: 1rem; }
.page-404 p { color: var(--on-violet-soft); }

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ---------- Impresión ---------- */

@media print {
    .site-header, .nav-toggle, .map, .gallery, .actions, .wa-float, .hero-watermark { display: none !important; }
    .hero, .section-violet, .site-footer { background: #fff !important; color: #000 !important; }
}
