/* ════════════════════════════════════════════════════════════════════
   Dunes Theme — El Tiempo (v2.25.6)
   Página premium /el-tiempo/. Claro, blanco + azul accent #33519F.
   ════════════════════════════════════════════════════════════════════ */

.et-weather {
    --etw-blue:       #33519F;
    --etw-blue-dark:  #1F3B85;
    --etw-blue-soft:  #EAF1FB;
    --etw-blue-line:  #DCE5F3;
    --etw-ink:        #0F1B3D;
    --etw-ink2:       #28335A;
    --etw-ink3:       #5A6580;
    --etw-ink4:       #8993AE;
    --etw-bg:         #F7F9FC;
    --etw-line:       #E6EAF2;

    /* Niveles de alerta */
    --etw-green:   #2EAD68;
    --etw-yellow:  #F5C518;
    --etw-orange:  #E6701B;
    --etw-red:     #C8102E;

    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 80px;
    color: var(--etw-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    box-sizing: border-box;
    width: 100%;
}
.et-weather *, .et-weather *::before, .et-weather *::after { box-sizing: border-box; }
/* v2.25.10 — anti-overflow horizontal en /el-tiempo/ móvil */
body.et-weather-page { overflow-x: hidden; }

/* ─── HERO ────────────────────────────────────────────────── */
.et-weather__hero {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--etw-line);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.et-weather__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 80% 20%, rgba(51,81,159,0.06), transparent 60%);
    pointer-events: none;
}
.et-weather__hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.et-weather__kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--etw-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 12px;
    background: var(--etw-blue-soft);
    border-radius: 100px;
    margin-bottom: 18px;
}
.et-weather__title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 16px;
    color: var(--etw-ink);
}
.et-weather__lede {
    font-size: 17px;
    line-height: 1.6;
    color: var(--etw-ink3);
    margin: 0 auto 20px;
    max-width: 620px;
}
.et-weather__lede strong { color: var(--etw-ink); font-weight: 600; }
.et-weather__hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--etw-ink4);
    font-family: 'JetBrains Mono', monospace;
}

/* ─── TABS ISLAS ──────────────────────────────────────────── */
.et-weather__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--etw-line);
    margin-bottom: 32px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.et-weather__tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.et-weather__tab {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 16px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--etw-ink3);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.et-weather__tab::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 3px;
    background: var(--etw-blue);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.et-weather__tab:hover {
    color: var(--etw-ink);
}
.et-weather__tab.is-active {
    color: var(--etw-blue);
}
.et-weather__tab.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ─── DROPDOWN ISLAS (móvil) ──────────────────────────────── */
.et-weather__select {
    display: none;
    position: relative;
    margin-bottom: 24px;
}
.et-weather__select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--etw-blue);
    color: #fff;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(51,81,159,0.22);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.et-weather__select-btn:active {
    background: var(--etw-blue-dark);
}
.et-weather__select-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.et-weather__select-caret {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.et-weather__select.is-open .et-weather__select-caret {
    transform: rotate(180deg);
}
.et-weather__select-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--etw-blue-line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15,27,61,0.12);
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 20;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.25s ease, max-height 0.3s ease;
}
.et-weather__select.is-open .et-weather__select-list {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.et-weather__select-list li { margin: 0; }
.et-weather__select-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: 0;
    padding: 13px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--etw-ink);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.et-weather__select-item:hover {
    background: var(--etw-blue-soft);
    color: var(--etw-blue);
}
.et-weather__select-item.is-active {
    background: var(--etw-blue);
    color: #fff;
}
.et-weather__select-item.is-active svg { color: #fff; }

/* ─── PANEL ──────────────────────────────────────────────── */
.et-weather__panel {
    display: none;
    animation: etw-fade 0.25s ease;
}
.et-weather__panel.is-active {
    display: block;
}
@keyframes etw-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── ALERTA AEMET ────────────────────────────────────────── */
.et-weather__alert {
    border-radius: 14px;
    margin-bottom: 28px;
    overflow: hidden;
    border: 1px solid var(--etw-line);
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,27,61,0.04);
}
.et-weather__alert-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 18px 24px;
}
.et-weather__alert-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.1em;
}
.et-weather__alert-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.6);
    animation: etw-pulse 2s ease-in-out infinite;
}
@keyframes etw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.15); }
}
.et-weather__alert--verde .et-weather__alert-bar    { background: rgba(46,173,104,0.12); color: var(--etw-green); }
.et-weather__alert--amarillo .et-weather__alert-bar { background: rgba(245,197,24,0.18); color: #9A7A0F; }
.et-weather__alert--naranja .et-weather__alert-bar  { background: rgba(230,112,27,0.16); color: var(--etw-orange); }
.et-weather__alert--rojo .et-weather__alert-bar     { background: rgba(200,16,46,0.14);  color: var(--etw-red); }

.et-weather__alert--verde    { border-left: 4px solid var(--etw-green); }
.et-weather__alert--amarillo { border-left: 4px solid var(--etw-yellow); }
.et-weather__alert--naranja  { border-left: 4px solid var(--etw-orange); }
.et-weather__alert--rojo     { border-left: 4px solid var(--etw-red); }

.et-weather__alert-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.et-weather__alert-body strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--etw-ink);
}
.et-weather__alert-msg {
    font-size: 13px;
    color: var(--etw-ink3);
    line-height: 1.5;
}
.et-weather__alert-src {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--etw-ink4);
    padding: 4px 10px;
    border: 1px solid var(--etw-line);
    border-radius: 100px;
}

/* ─── TIEMPO ACTUAL ───────────────────────────────────────── */
.et-weather__current {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 32px;
    padding: 36px;
    background: linear-gradient(135deg, #fff 0%, var(--etw-blue-soft) 100%);
    border: 1px solid var(--etw-blue-line);
    border-radius: 18px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}
.et-weather__current::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(51,81,159,0.08), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}
.et-weather__current-main {
    position: relative;
    z-index: 1;
}
.et-weather__current-loc {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}
.et-weather__current-island {
    font-size: 28px;
    font-weight: 800;
    color: var(--etw-ink);
    letter-spacing: -0.02em;
}
.et-weather__current-city {
    font-size: 14px;
    color: var(--etw-ink3);
    margin-top: 2px;
}
.et-weather__current-temp-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.et-weather__current-icon {
    flex-shrink: 0;
    padding: 8px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15,27,61,0.06);
}
.et-weather__current-temp-wrap {
    display: flex;
    flex-direction: column;
}
.et-weather__current-temp {
    font-size: 88px;
    font-weight: 200;
    line-height: 1;
    color: var(--etw-ink);
    letter-spacing: -0.04em;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}
.et-weather__deg {
    font-size: 0.55em;
    font-weight: 400;
    vertical-align: top;
    margin-left: 4px;
    color: var(--etw-blue);
}
.et-weather__current-cond {
    font-size: 17px;
    color: var(--etw-ink2);
    font-weight: 500;
    margin-top: 4px;
}
.et-weather__current-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--etw-ink3);
    padding-top: 18px;
    border-top: 1px solid var(--etw-blue-line);
}
.et-weather__current-summary strong {
    color: var(--etw-ink);
    font-weight: 700;
}

/* ─── MÉTRICAS GRID ───────────────────────────────────────── */
.et-weather__metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
}
.et-weather__metric {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px;
    background: #fff;
    border: 1px solid var(--etw-line);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.et-weather__metric:hover {
    border-color: var(--etw-blue-line);
    box-shadow: 0 4px 14px rgba(15,27,61,0.06);
    transform: translateY(-1px);
}
.et-weather__metric-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--etw-blue-soft);
    color: var(--etw-blue);
    border-radius: 8px;
}
.et-weather__metric-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.et-weather__metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--etw-ink4);
}
.et-weather__metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--etw-ink);
    line-height: 1.2;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.et-weather__metric-sub {
    font-size: 11px;
    color: var(--etw-ink3);
    margin-top: 2px;
}

/* ─── PRONÓSTICO 7 DÍAS ───────────────────────────────────── */
.et-weather__forecast {
    background: #fff;
    border: 1px solid var(--etw-line);
    border-radius: 18px;
    padding: 28px;
}
.et-weather__forecast-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--etw-line);
}
.et-weather__h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: var(--etw-ink);
    letter-spacing: -0.015em;
}
.et-weather__forecast-src {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--etw-ink4);
}
.et-weather__forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.et-weather__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 8px;
    background: var(--etw-bg);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: center;
}
.et-weather__day:hover {
    background: #fff;
    border-color: var(--etw-blue-line);
    box-shadow: 0 4px 14px rgba(15,27,61,0.05);
}
.et-weather__day.is-today {
    background: var(--etw-blue);
    color: #fff;
    border-color: var(--etw-blue);
}
.et-weather__day-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.et-weather__day-name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
}
.et-weather__day.is-today .et-weather__day-name { color: #fff; }
.et-weather__day-date {
    font-size: 11px;
    color: var(--etw-ink4);
    font-variant-numeric: tabular-nums;
}
.et-weather__day.is-today .et-weather__day-date { color: rgba(255,255,255,0.7); }
.et-weather__day-icon {
    margin: 10px 0;
}
.et-weather__day.is-today .et-weather__day-icon svg { filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,0.2)); }
.et-weather__day-cond {
    font-size: 11px;
    color: var(--etw-ink3);
    line-height: 1.3;
    min-height: 28px;
    margin-bottom: 8px;
}
.et-weather__day.is-today .et-weather__day-cond { color: rgba(255,255,255,0.85); }
.et-weather__day-temps {
    display: flex;
    gap: 10px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}
.et-weather__day-max {
    font-size: 17px;
    font-weight: 700;
    color: var(--etw-ink);
}
.et-weather__day-min {
    font-size: 17px;
    font-weight: 400;
    color: var(--etw-ink4);
}
.et-weather__day.is-today .et-weather__day-max,
.et-weather__day.is-today .et-weather__day-min { color: #fff; }
.et-weather__day.is-today .et-weather__day-min { opacity: 0.7; }
.et-weather__day-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--etw-ink3);
}
.et-weather__day.is-today .et-weather__day-meta { color: rgba(255,255,255,0.8); }
.et-weather__day-rain, .et-weather__day-wind {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ─── EMPTY ───────────────────────────────────────────────── */
.et-weather__empty {
    padding: 60px 30px;
    text-align: center;
    color: var(--etw-ink3);
    background: var(--etw-bg);
    border-radius: 14px;
}

/* ─── FOOTER NOTE ─────────────────────────────────────────── */
.et-weather__footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--etw-line);
    font-size: 13px;
    color: var(--etw-ink4);
    line-height: 1.6;
}
.et-weather__footer a {
    color: var(--etw-blue);
    text-decoration: none;
    border-bottom: 1px solid var(--etw-blue-line);
}
.et-weather__footer a:hover { color: var(--etw-blue-dark); border-bottom-color: var(--etw-blue); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .et-weather__current {
        grid-template-columns: 1fr;
    }
    .et-weather__metrics {
        grid-template-columns: repeat(4, 1fr);
    }
    .et-weather__forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .et-weather__forecast-grid .et-weather__day:nth-child(n+8) { display: none; }
}
@media (max-width: 1024px) {
    /* En tablet y móvil mostramos dropdown, ocultamos tabs */
    .et-weather__tabs { display: none; }
    .et-weather__select { display: block; }
}

@media (max-width: 768px) {
    .et-weather {
        /* iPhone: márgenes laterales generosos + safe-area + sin overflow horizontal */
        padding-left: calc(20px + env(safe-area-inset-left, 0px)) !important;
        padding-right: calc(20px + env(safe-area-inset-right, 0px)) !important;
        padding-bottom: 60px;
        overflow-x: hidden;
    }
    /* Anti-overflow: cualquier hijo nunca debe rebasar el ancho del contenedor */
    .et-weather > *,
    .et-weather__current,
    .et-weather__forecast,
    .et-weather__alert,
    .et-weather__select,
    .et-weather__select-btn,
    .et-weather__forecast-grid > * {
        max-width: 100%;
    }
    .et-weather__hero {
        padding: 36px 0 24px;
    }
    .et-weather__title {
        font-size: 34px;
    }
    .et-weather__lede {
        font-size: 15px;
    }
    .et-weather__current {
        padding: 22px 18px;
        gap: 20px;
        border-radius: 16px;
    }
    .et-weather__current-temp {
        font-size: 68px;
    }
    .et-weather__current-island {
        font-size: 22px;
    }
    .et-weather__metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .et-weather__forecast {
        padding: 20px 16px;
        border-radius: 16px;
    }
    .et-weather__forecast-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .et-weather__alert {
        border-radius: 12px;
    }
    .et-weather__alert-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 16px;
    }
    .et-weather__alert-src { justify-self: start; }

    /* DÍA EN 2 LÍNEAS
       Layout:
         [icon] [HOY  22 may          ] [24° 17°]
         [icon] [Parcialmente nublado ] [💧10% 💨34]
    */
    .et-weather__day {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "icon head temps"
            "icon cond meta";
        column-gap: 14px;
        row-gap: 4px;
        align-items: center;
        padding: 14px 16px;
        text-align: left;
    }
    .et-weather__day-icon {
        grid-area: icon;
        margin: 0;
        display: flex;
        align-items: center;
    }
    .et-weather__day-head {
        grid-area: head;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }
    .et-weather__day-name { font-size: 14px; }
    .et-weather__day-date { font-size: 12px; }
    .et-weather__day-cond {
        grid-area: cond;
        font-size: 13px;
        color: var(--etw-ink3);
        min-height: 0;
        margin: 0;
        line-height: 1.3;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .et-weather__day.is-today .et-weather__day-cond { color: rgba(255,255,255,0.92); }
    .et-weather__day-temps {
        grid-area: temps;
        justify-content: flex-end;
        gap: 8px;
        margin: 0;
        font-variant-numeric: tabular-nums;
    }
    .et-weather__day-max { font-size: 17px; }
    .et-weather__day-min { font-size: 17px; }
    .et-weather__day-meta {
        grid-area: meta;
        gap: 10px;
        justify-content: flex-end;
        font-size: 11px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .et-weather {
        padding-left: calc(18px + env(safe-area-inset-left, 0px)) !important;
        padding-right: calc(18px + env(safe-area-inset-right, 0px)) !important;
        padding-bottom: 60px;
    }
    .et-weather__title {
        font-size: 28px;
    }
    .et-weather__metrics {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .et-weather__current {
        padding: 20px 16px;
    }
    .et-weather__current-temp {
        font-size: 60px;
    }
    .et-weather__current-temp-row {
        gap: 12px;
    }
    .et-weather__current-icon {
        padding: 4px;
        border-radius: 14px;
    }
    .et-weather__current-icon svg {
        width: 72px;
        height: 72px;
    }
}
