/* ============================================================
   TSM — Global Design System (shared across all pages)
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    /* Brand palette — TSM official Pantone references
       (Pantone 1788 C / 279 C / 375 C / 1495 C / Neutral Black C) */
    --primary: #F02F43;        /* Pantone 1788 C — rojo TSM */
    --primary-light: #FFE3E6;
    --primary-dark: #C4162A;
    --blue: #1188F0;           /* Pantone 279 C */
    --blue-light: #DBEDFF;
    --blue-dark: #0A6BC4;
    --green: #8AD431;          /* Pantone 375 C */
    --green-light: #EAF8D0;
    --green-dark: #6DAA22;
    --orange: #FF973E;         /* Pantone 1495 C */
    --orange-light: #FFE8D0;
    --orange-dark: #D67220;
    --coral: #F02F43;
    --coral-light: #FFE3E6;
    --dark: #1A1A18;
    --dark-soft: #2A2A28;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6B7280;
    --gray-300: #D1D5DB;
    --gray-100: #F3F4F6;
    --white: #FFFFFF;
    /* Editorial paper tokens (warm, not stark) */
    --paper: #FAFAF7;
    --paper-tint: #F2EFE7;
    --paper-line: #E5E1D8;
    --ink: #0F172A;
    --ink-muted: #475569;
    /* Tu Parque (environmental) — uses brand green */
    --park-green: #8AD431;
    --park-green-dark: #6DAA22;
    --park-green-soft: #EAF8D0;
    /* Tu Parque sub-brand palette — Pantone 368 C / 1788 C / 137 C / 285 C */
    --tp-green: #76BC21;       /* 368 C — hoja / naturaleza */
    --tp-green-ink: #5A9119;
    --tp-coral: #F32735;       /* 1788 C — pétalo / comunidad */
    --tp-coral-ink: #CE1E28;
    --tp-sun:   #FFA400;       /* 137 C — sol / palapa */
    --tp-sun-ink:  #B87400;
    --tp-water: #0071CE;       /* 285 C — agua / fresco */
    --tp-water-ink: #005CA8;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 999px;
    --font: 'Inter', -apple-system, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 4px 24px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 48px rgba(0,0,0,.12);
    --transition: .3s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.05; }

/* A11y: visible focus ring across all interactive elements */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Respect reduced motion preference globally */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

.container {
    width: min(90%, 1200px);
    margin: 0 auto;
}

/* ---------- Reusable Components ---------- */
.pill {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: #9F1239;
}
.pill--dark   { background: var(--gray-900); color: var(--white); }
.pill--green  { background: var(--green-light); color: #4A6D12; }
.pill--coral  { background: var(--coral-light); color: #9F1239; }
.pill--blue   { background: var(--blue-light); color: #1E40AF; }
.pill--orange { background: var(--orange-light); color: #9A3412; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}
.btn--primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn--primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(242,48,84,.3);
}
.btn--outline {
    background: transparent;
    color: var(--gray-900);
    border-color: var(--gray-300);
}
.btn--outline:hover {
    border-color: var(--gray-900);
    transform: translateY(-2px);
}
.btn--white {
    background: var(--white);
    color: var(--gray-900);
}
.btn--white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--outline-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,.4);
}
.btn--outline-white:hover { border-color: var(--white); }
.btn--lg { padding: 18px 40px; font-size: 18px; border-radius: var(--radius-lg); }

.placeholder {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gray-500);
    min-height: 280px;
    width: 100%;
    border: 2px dashed var(--gray-300);
}
.placeholder svg { width: 48px; height: 48px; }
.placeholder span { font-size: 14px; font-weight: 500; }
.placeholder--tall { min-height: 420px; }

/* Section spacing */
.section {
    padding: 120px 0;
}
.section--gray {
    background: var(--gray-100);
}
.section--dark {
    background: var(--dark);
    color: var(--white);
}

.section__header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.section__header h2 {
    font-family: var(--font);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-top: 16px;
}

.section__header p {
    font-size: 18px;
    color: var(--gray-500);
    line-height: 1.7;
    margin-top: 16px;
}

/* Page hero (reusable for inner pages) */
.page-hero {
    padding: 160px 0 80px;
    background:
        radial-gradient(ellipse 80% 60% at 70% 40%, rgba(242,48,84,.05) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(19,157,242,.04) 0%, transparent 50%),
        var(--white);
}

.page-hero__inner {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.page-hero h1 {
    font-family: var(--font);
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 900;
    letter-spacing: -2px;
    margin: 16px 0;
}

.page-hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--gray-500);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 1200px);
    z-index: 100;
    padding: 10px 14px 10px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    box-shadow: 0 18px 44px -16px rgba(15, 23, 42, .14);
    transition: top .3s ease, padding .3s ease, box-shadow .3s ease, background .3s ease;
}
/* Gradient border (only the ring — uses mask-composite) */
.nav::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(90deg,
        var(--orange)  0 25%,
        var(--green)   25% 50%,
        var(--primary) 50% 75%,
        var(--blue)    75% 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.nav--scrolled {
    top: 10px;
    padding: 8px 12px 8px 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 32px -10px rgba(15, 23, 42, .18);
}

.nav__inner {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 36px;
    position: relative;
    z-index: 1;
}

.nav__logo img { height: 48px; width: auto; display: block; }

.nav__links {
    display: flex;
    gap: 32px;
    margin-left: auto;
}

.nav__links a,
.nav__links .nav__parent {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
    position: relative;
}
.nav__links .nav__parent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.nav__links > .nav__item > a::after,
.nav__links > .nav__item > .nav__parent::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav__links a:hover,
.nav__links .nav__parent:hover { color: var(--gray-900); }
.nav__links > .nav__item > a:hover::after,
.nav__links > .nav__item > .nav__parent:hover::after { width: 100%; }
.nav__links a.is-active,
.nav__links .nav__parent.is-active { color: var(--gray-900); }
.nav__links > .nav__item > a.is-active::after,
.nav__links > .nav__item > .nav__parent.is-active::after { width: 100%; }

/* Dropdown submenu */
.nav__item { position: relative; list-style: none; }
.nav__chevron { transition: transform .25s ease; }
.nav__item--dropdown:hover .nav__chevron,
.nav__item--dropdown:focus-within .nav__chevron,
.nav__item--dropdown.is-open .nav__chevron { transform: rotate(180deg); }

.nav__submenu {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: calc(100% + 18px);
    left: -12px;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    box-shadow: 0 18px 44px -14px rgba(15, 23, 42, .2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 10;
}
.nav__submenu::before {
    content: "";
    position: absolute;
    top: -18px; left: 0; right: 0;
    height: 18px;
}
.nav__item--dropdown:hover > .nav__submenu,
.nav__item--dropdown:focus-within > .nav__submenu,
.nav__item--dropdown.is-open > .nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav__submenu a {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
    transition: var(--transition);
}
.nav__submenu a::after { display: none; }
.nav__submenu a:hover { background: var(--paper-tint); color: var(--primary); }
.nav__submenu a.is-active { background: var(--paper-tint); color: var(--primary); }

.nav__cta {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    padding: 10px 22px;
    background: var(--primary);
    color: var(--white);
    border-radius: 999px;
    transition: var(--transition);
    flex: none;
}
.nav__cta:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(240, 47, 67, .5);
}
.nav--scrolled .nav__cta { padding: 8px 20px; }

.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.nav__burger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--gray-900);
    border-radius: 2px;
    transition: var(--transition);
}
.nav__burger.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   FOOTER — editorial light
   ============================================================ */
.footer {
    position: relative;
    padding: 80px 0 32px;
    background: var(--paper);
    color: var(--ink-muted);
}
.footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--orange)  0 25%,
        var(--green)   25% 50%,
        var(--primary) 50% 75%,
        var(--blue)    75% 100%
    );
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--paper-line);
}

.footer__logo {
    height: 64px;
    width: auto;
    margin-bottom: 20px;
    filter: none;
}

.footer__brand p {
    font-size: 15px;
    line-height: 1.6;
    max-width: 300px;
    color: var(--ink-muted);
}

.footer__col h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--ink);
    margin-bottom: 20px;
}

.footer__col ul { display: flex; flex-direction: column; gap: 12px; list-style: none; padding: 0; }
.footer__col li { font-size: 15px; color: var(--ink-muted); }
.footer__col a { color: var(--ink); transition: var(--transition); }
.footer__col a:hover { color: var(--primary); }

.footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.footer__contact svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--primary);
}

.footer__social {
    display: flex;
    gap: 10px;
}

.footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--paper-tint);
    border: 1px solid var(--paper-line);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--ink);
    transition: var(--transition);
}
.footer__social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.footer__bottom {
    padding-top: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .section { padding: 80px 0; }
}

@media (max-width: 767px) {
    .nav { padding: 8px 8px 8px 16px; }
    .nav__logo img { height: 40px; }

    .nav__links {
        display: none;
        position: absolute;
        top: calc(100% + 10px); left: 0; right: 0;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(22px) saturate(1.5);
        -webkit-backdrop-filter: blur(22px) saturate(1.5);
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        box-shadow: 0 18px 44px -14px rgba(15, 23, 42, .18);
        border: 1px solid rgba(15, 23, 42, .08);
        border-radius: 20px;
    }
    .nav__links.is-open { display: flex; }
    .nav__cta { display: none; }
    .nav__burger { display: flex; }

    /* Submenu: flatten inline on mobile */
    .nav__submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 4px 0 4px 16px;
        margin-top: 6px;
        min-width: 0;
    }
    .nav__submenu::before { display: none; }
    .nav__item--dropdown .nav__chevron { display: none; }

    .section { padding: 60px 0; }
    .page-hero { padding: 120px 0 60px; }
    .footer__grid { grid-template-columns: 1fr; gap: 32px; }
}
