/* =========================================
   Taller en Campo — styles.css
   ========================================= */

/* ---- Variables ---- */
:root {
    --c-cream:     #f8f2e3;
    --c-green-d:   #1d413c;
    --c-green-m:   #5e9c8b;
    --c-green-m-h: #4f8978;
    --c-coral:     #c47a5e;
    --c-coral-d:   #a65a3f;
    --c-text:      #2a2a2a;
    --c-text-soft: #5a5a5a;
    --c-white:     #ffffff;
    --c-line:      rgba(255, 255, 255, 0.18);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);
    --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.12);

    --container: 1180px;
    --gutter: clamp(1rem, 3vw, 2rem);

    --header-h: 72px;

    --t-fast: 180ms ease;
    --t-med:  320ms ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-cream);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
input, select, textarea { font: inherit; color: inherit; }

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

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--c-coral);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.eyebrow--light { color: var(--c-coral); }

.section-title {
    font-size: clamp(1.5rem, 2.5vw + 1rem, 2.4rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--c-coral);
    margin-bottom: 1rem;
}
.section-title--light { color: var(--c-white); }

.section-subtitle {
    font-size: 0.98rem;
    color: var(--c-text-soft);
    max-width: 70ch;
    margin: 0 auto;
}
.section-subtitle--light { color: rgba(255, 255, 255, 0.85); margin: 0; }

/* ---- Botones ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.75rem 1.4rem;
    color: var(--c-white);
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn--lg { padding: 0.95rem 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--coral { background: var(--c-coral); }
.btn--coral:hover { background: var(--c-coral-d); }
.btn--green { background: var(--c-green-m); }
.btn--green:hover { background: var(--c-green-m-h); }
.btn--ghost {
    background: transparent;
    color: var(--c-white);
    border: 1px solid rgba(255,255,255,0.4);
}
.btn--ghost:hover { background: rgba(255,255,255,0.08); }

.btn__icon { display: inline-flex; }

/* ---- Site header ---- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    background: var(--c-cream);
    box-shadow: var(--shadow-header);
    transform: translateY(-100%);
    transition: transform var(--t-med);
}
.site-header.is-visible { transform: translateY(0); }

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    max-width: var(--container);
    margin: 0 auto;
}
.site-header__logo img {
    height: 30px;
    width: auto;
}
.site-header__ctas {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* En mobile, el header siempre visible. Las CTAs muestran solo iconos para ahorrar espacio. */
@media (max-width: 720px) {
    .site-header { transform: translateY(0); }
    .site-header__logo img { height: 20px; }
    .site-header__ctas .btn { padding: 0.55rem 0.8rem; }
    .site-header__ctas .btn__label { display: none; }
    :root { --header-h: 64px; }
}

/* ---- HERO ---- */
.hero {
    position: relative;
    min-height: clamp(560px, 92vh, 820px);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--c-cream);
    padding: calc(var(--header-h) + 2rem) var(--gutter) 4rem;
    text-align: center;
}
.hero__bg {
    position: absolute;
    inset: 0;
    background: #2d4a3a url('../img/hero-bg.jpg') center/cover no-repeat;
    z-index: 0;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(31, 77, 68, 0.35) 0%, rgba(31, 77, 68, 0.55) 60%, rgba(31, 77, 68, 0.70) 100%);
    z-index: 1;
}
.hero__content {
    position: relative;
    z-index: 2;
    max-width: 760px;
}
.hero__logo {
    width: clamp(140px, 18vw, 200px);
    height: auto;
    margin: 0 auto 1.5rem;
}
.hero__eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}
.hero__title {
    font-size: clamp(1.75rem, 3.4vw + 1rem, 3.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hero__subtitle {
    font-size: clamp(0.95rem, 0.6vw + 0.85rem, 1.1rem);
    max-width: 56ch;
    margin: 0 auto 2rem;
    color: var(--c-cream);
    line-height: 1.6;
}
.hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

/* ---- SERVICIOS ---- */
.services { padding: clamp(3rem, 6vw, 5rem) 0; background: var(--c-cream); }
.services__intro { text-align: center; max-width: 720px; margin: 0 auto 2.75rem; }
.services__badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--c-green-m);
    color: var(--c-white);
    display: grid;
    place-items: center;
    margin: 0 auto 1.25rem;
    box-shadow: var(--shadow-card);
}

.services__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 560px) {
    .services__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .services__grid { grid-template-columns: repeat(4, 1fr); }
}

.service-card {
    background: var(--c-green-m);
    color: var(--c-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform var(--t-med), box-shadow var(--t-med);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.16);
}
.service-card__img {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #d8cbb6;
}
.service-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.service-card__body { padding: 1.1rem 1.2rem 1.4rem; }
.service-card__title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}
.service-card__text {
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.92);
}

/* ---- COBERTURA ---- */
.coverage {
    background: var(--c-green-d);
    color: var(--c-white);
    padding: clamp(3rem, 6vw, 5rem) 0;
}
.coverage__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}
@media (min-width: 880px) {
    .coverage__grid { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}

.zones { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.75rem; max-width: 460px; }
.zone {
    background: var(--c-coral);
    color: var(--c-white);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.zone__title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.15rem; }
.zone__towns { font-size: 0.8rem; opacity: 0.92; }

.coverage__radar { display: grid; place-items: center; }
.radar { width: 100%; max-width: 420px; height: auto; }

/* Sweep rotatorio (cono giratorio) */
.radar__sweep {
    transform-box: view-box;
    transform-origin: 200px 200px;
    animation: radar-sweep 5s linear infinite;
}
@keyframes radar-sweep {
    to { transform: rotate(360deg); }
}

/* Pulsos expansivos desde Zaragoza */
.radar__pulse {
    transform-box: view-box;
    transform-origin: 200px 200px;
    opacity: 0;
    animation: radar-pulse 3s ease-out infinite;
}
.radar__pulse--delayed { animation-delay: 1.5s; }
@keyframes radar-pulse {
    0%   { transform: scale(0.4); opacity: 0.7; }
    80%  { opacity: 0.05; }
    100% { transform: scale(18);  opacity: 0; }
}

/* Marcha de dashes en el anillo de 80 km */
.radar__ring--outer {
    animation: radar-march 14s linear infinite;
}
@keyframes radar-march {
    to { stroke-dashoffset: -200; }
}

/* ---- CONTACTO ---- */
.contact {
    background: var(--c-coral);
    color: var(--c-white);
    padding: clamp(3rem, 6vw, 5rem) 0;
}
.contact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}
@media (min-width: 880px) {
    .contact__grid { grid-template-columns: 1fr 1.2fr; gap: 3rem; }
}

.contact__info { padding-top: 0.5rem; }
.contact__list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.contact__item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.25);
}
.contact__item:last-child { border-bottom: 0; }
.contact__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: grid;
    place-items: center;
    color: var(--c-white);
    flex-shrink: 0;
}
.contact__label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.15rem;
}
.contact__value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--c-white);
    text-decoration: none;
}
.contact__value:hover { text-decoration: underline; }

/* ---- Formulario ---- */
.contact-form {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.field { position: relative; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
    width: 100%;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--c-white);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.1rem;
    font-size: 0.98rem;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255,255,255,0.85); }
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.field select option { color: var(--c-text); background: var(--c-white); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    background: rgba(255,255,255,0.32);
    border-color: var(--c-white);
    outline: none;
}
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
    border-color: #ffd3c5;
    background: rgba(255, 211, 197, 0.18);
}

.field--check {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.78rem;
    line-height: 1.5;
    margin-top: 0.4rem;
}
.field--check input[type="checkbox"] {
    margin-top: 0.2rem;
    accent-color: var(--c-green-d);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.field--check a { text-decoration: underline; }

/* Honeypot: invisible para humanos pero presente en el DOM.
   Capas múltiples para que bots que solo respetan una técnica caigan igual. */
.hp {
    position: absolute !important;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.hp input { pointer-events: none; }

.form-status {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    min-height: 1.3em;
}
.form-status.is-ok { color: #d6ffe9; font-weight: 600; }
.form-status.is-error { color: #ffd3c5; font-weight: 600; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--c-green-d);
    color: var(--c-white);
    padding: 2rem 0 2.25rem;
    text-align: center;
}
.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.site-footer__logo { width: 140px; height: auto; }
.site-footer__copy {
    font-size: 0.78rem;
    opacity: 0.85;
}
.site-footer__links {
    display: flex;
    gap: 0.6rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
}
.site-footer__links a { opacity: 0.95; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__links span { opacity: 0.5; }

/* ---- Cookie banner ---- */
.cookie-banner {
    position: fixed;
    inset: auto 1rem 1rem auto;
    z-index: 60;
    background: var(--c-green-d);
    color: var(--c-white);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 36px rgba(0,0,0,0.32);
    max-width: 520px;
    width: calc(100% - 2rem);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__content { padding: 1.1rem 1.25rem; }
.cookie-banner__title {
    font-size: 1rem;
    letter-spacing: 0.04em;
    margin: 0 0 0.45rem;
}
.cookie-banner__text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.92);
    margin: 0 0 0.9rem;
}
.cookie-banner__details {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0 0 0.9rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255,255,255,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.18);
}
.cookie-banner__details[hidden] { display: none; }
.cookie-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.86rem;
    line-height: 1.4;
    cursor: pointer;
}
.cookie-toggle input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--c-coral);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}
.cookie-toggle input[disabled] { cursor: not-allowed; opacity: 0.7; }
.cookie-toggle small {
    display: block;
    opacity: 0.78;
    font-size: 0.76rem;
    margin-top: 0.15rem;
}
.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}
.btn-cookie {
    border-radius: var(--radius-pill);
    padding: 0.55rem 1.05rem;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.btn-cookie[hidden] { display: none; }
.btn-cookie--ghost {
    background: transparent;
    color: var(--c-white);
    border-color: rgba(255,255,255,0.45);
}
.btn-cookie--ghost:hover { background: rgba(255,255,255,0.10); }
.btn-cookie--primary {
    background: var(--c-coral);
    color: var(--c-white);
}
.btn-cookie--primary:hover { background: var(--c-coral-d); }
.cookie-banner__link {
    margin: 0.75rem 0 0;
    font-size: 0.78rem;
    opacity: 0.85;
}
.cookie-banner__link a { text-decoration: underline; }

@media (max-width: 520px) {
    .cookie-banner {
        inset: auto 0.6rem 0.6rem 0.6rem;
        width: auto;
    }
    .cookie-banner__actions { justify-content: stretch; }
    .cookie-banner__actions .btn-cookie { flex: 1 1 calc(50% - 0.45rem); }
}

/* ---- Fade-in al entrar en viewport ---- */
/* Solo se aplica si JS ha cargado (evita que se queden invisibles si JS falla) */
.js-ready .fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
    will-change: opacity, transform;
}
.js-ready .fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger: cada elemento dentro del mismo contenedor entra 100 ms después */
.services__grid .fade-in:nth-child(1),
.zones .fade-in:nth-child(1) { transition-delay: 0ms; }
.services__grid .fade-in:nth-child(2),
.zones .fade-in:nth-child(2) { transition-delay: 450ms; }
.services__grid .fade-in:nth-child(3),
.zones .fade-in:nth-child(3) { transition-delay: 900ms; }
.services__grid .fade-in:nth-child(4),
.zones .fade-in:nth-child(4) { transition-delay: 1350ms; }
.zones .fade-in:nth-child(5)  { transition-delay: 1800ms; }

/* ---- Motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
