/* ===========================
   MODAL CLIMA
=========================== */

.clima-modal {
    position: fixed;
    inset: 0;
    z-index: 4500;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(35, 35, 35, 0);
    opacity: 0;
    transition: opacity 0.32s ease, background 0.32s ease;
}

.clima-modal.is-visible {
    display: flex;
}

.clima-modal.show {
    opacity: 1;
    background: rgba(35, 35, 35, 0.35);
}

.clima-modal.closing {
    opacity: 0;
    background: rgba(35, 35, 35, 0);
}

.clima-inner {
    width: 100%;
    max-width: 980px;
    background: #f7eee7;
    padding: 88px 30px 34px;
    position: relative;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.clima-close {
    position: absolute;
    top: 24px;
    right: 42px;
    border: none;
    background: transparent;
    color: #963d56;
    font-size: 58px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    z-index: 2;
}

.clima-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
}

.clima-card {
    background: #ead8c8;
    border-radius: 14px;
    padding: 18px 20px;
    color: #963d56;
    min-height: 340px;
    border: 1px solid transparent;
}

.clima-card.is-today {
    background: #f7eee7;
    border-color: #963d56;
}

.clima-day {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.clima-date {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 22px;
}

.clima-icon-wrap {
    height: 58px;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.clima-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.clima-desc {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 24px;
}

.clima-temp {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
}

.clima-temp-max {
    color: #963d56;
    font-size: 38px;
    font-weight: 800;
}

.clima-temp-min {
    color: #c99b4a;
    font-size: 26px;
    font-weight: 800;
}

.clima-meta {
    font-size: 14px;
    line-height: 1.65;
    color: #963d56;
}

.clima-meta b {
    font-weight: 800;
}

.clima-hourly-btn {
    width: 100%;
    margin-top: 14px;
    border: none;
    border-radius: 3px;
    background: #c99b4a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 9px 12px;
    cursor: pointer;
}

.clima-hourly-btn:hover {
    background: #a77e39;
}

.clima-loading,
.clima-error {
    text-align: center;
    color: #963d56;
    font-weight: 800;
    font-size: 18px;
    padding: 25px;
}

@media (max-width: 768px) {
    .clima-modal {
        align-items: flex-start;
        padding-top: 0;
    }

    .clima-inner {
        max-width: none;
        width: 100%;
        max-height: 58vh;
        overflow-y: auto;
        border-radius: 0;
        padding: 82px 28px 34px;
        margin-top: 0;
    }

    .clima-close {
        top: 20px;
        right: 28px;
        font-size: 54px;
    }

    .clima-grid {
        display: grid;
        grid-template-columns: repeat(4, 210px);
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .clima-card {
        min-height: 330px;
    }
}

@media (max-width: 480px) {
    .clima-inner {
        padding-left: 28px;
        padding-right: 28px;
    }

    .clima-grid {
        grid-template-columns: repeat(4, 210px);
    }
}

/* ===========================
   AJUSTE MODAL CLIMA 80%
=========================== */

.clima-inner {
    width: 80vw;
    height: 80vh;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    background: #f7eee7;
    padding: 30px 30px 34px;
    position: relative;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    border-radius: 24px;
}

.clima-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 18px;
}

.clima-card {
    min-height: 390px;
}

.clima-close {
    position: absolute;
    top: 24px;
    right: 42px;
    border: none;
    background: transparent;
    color: #963d56;
    font-size: 58px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    z-index: 2;
}

/* ===========================
   PRONÓSTICO HORARIO
=========================== */

.clima-hourly-panel {
    margin-top: 28px;
    border-top: 2px solid rgba(150, 61, 86, 0.18);
    padding-top: 24px;
}

.clima-hourly-title {
    color: #963d56;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 18px;
}

.clima-hourly-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clima-hourly-item {
    background: #ead8c8;
    border: 1px solid rgba(150, 61, 86, 0.18);
    border-radius: 12px;
    overflow: hidden;
}

.clima-hourly-main {
    display: grid;
    grid-template-columns: 95px 80px 120px 1fr 40px;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    color: #963d56;
}

.clima-hourly-time {
    font-weight: 900;
    font-size: 16px;
}

.clima-hourly-date {
    display: block;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
    margin-top: 3px;
}

.clima-hourly-icon {
    font-size: 34px;
    color: #c99b4a;
    text-align: center;
}

.clima-hourly-temp {
    font-size: 30px;
    font-weight: 900;
    color: #333333;
}

.clima-hourly-desc {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 5px;
    text-align: center;
    color: #333333;
}

.clima-hourly-arrow {
    font-size: 24px;
    font-weight: 900;
    text-align: right;
    color: #333333;
}

.clima-hourly-detail {
    display: none;
    padding: 0 18px 18px 18px;
    color: #963d56;
    font-size: 15px;
    line-height: 1.65;
}

.clima-hourly-item.open .clima-hourly-detail {
    display: block;
}

.clima-hourly-item.open .clima-hourly-arrow {
    transform: rotate(180deg);
}

.clima-hourly-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 6px 20px;
    padding-top: 8px;
}

.clima-hourly-detail-grid b {
    font-weight: 900;
}

/* Responsive */
@media (max-width: 900px) {
    .clima-inner {
        width: 92vw;
        height: 80vh;
        padding: 82px 22px 30px;
    }

    .clima-grid {
        grid-template-columns: repeat(4, 210px);
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .clima-hourly-main {
        grid-template-columns: 75px 50px 90px 1fr 30px;
        gap: 10px;
        padding: 12px;
    }

    .clima-hourly-desc {
        font-size: 14px;
        letter-spacing: 3px;
    }

    .clima-hourly-temp {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .clima-inner {
        width: 100vw;
        height: 80vh;
        padding: 78px 18px 28px;
    }

    .clima-hourly-main {
        grid-template-columns: 70px 42px 75px 1fr 24px;
        gap: 8px;
    }

    .clima-hourly-icon {
        font-size: 26px;
    }

    .clima-hourly-temp {
        font-size: 22px;
    }

    .clima-hourly-desc {
        font-size: 13px;
        letter-spacing: 2px;
        text-align: left;
    }

    .clima-hourly-detail-grid {
        grid-template-columns: 1fr;
    }
}

.clima-hourly-btn.active {
    background: #963d56;
}

.clima-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.clima-hourly-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.clima-hourly-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.clima-header-title {
    margin-bottom: 44px;
    padding-right: 70px;
    width: 100%;
    text-align: center;
}

.clima-header-title h2 {
    margin: 0;
    color: #963d56;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.2;
}

.clima-source {
    margin-top: 14px;
    text-align: right;
    color: #963d56;
    font-size: 14px;
    font-weight: 700;
    opacity: 1;
}

/* Ajuste móvil */
@media (max-width: 768px) {
    .clima-header-title {
        padding-right: 48px;
        margin-bottom: 20px;
    }

    .clima-header-title h2 {
        font-size: 22px;
    }

    .clima-source {
        font-size: 13px;
        padding-right: 4px;
    }
}

.clima-inner {
    transform: translateY(22px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s ease, opacity 0.32s ease;
    border-radius: 24px;
}

.clima-modal.show .clima-inner {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.clima-modal.closing .clima-inner {
    transform: translateY(22px) scale(0.97);
    opacity: 0;
}

@media (max-width: 768px) {
    .clima-inner {
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .clima-inner {
        border-radius: 18px;
    }
}

/* Scroll del modal clima */
.clima-inner {
    scrollbar-width: thin;
    scrollbar-color: #963d56 #ead8c8;
}

/* Chrome, Edge, Safari */
.clima-inner::-webkit-scrollbar {
    width: 12px;
}

.clima-inner::-webkit-scrollbar-track {
    background: #ead8c8;
    border-radius: 20px;
}

.clima-inner::-webkit-scrollbar-thumb {
    background: #963d56;
    border-radius: 20px;
    border: 3px solid #ead8c8;
}

.clima-inner::-webkit-scrollbar-thumb:hover {
    background: #7d2f46;
}

/* ===========================
   CLIMA MODAL - MÓVIL
=========================== */
@media (max-width: 768px) {

    .clima-modal {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .clima-inner {
        width: 92vw;
        height: 82vh;
        max-width: 420px;
        max-height: 82vh;
        margin: 0 auto;
        padding: 30px 18px 28px;
        border-radius: 20px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .clima-close {
        top: 26px;
        right: 28px;
        font-size: 46px;
    }

    .clima-header-title {
        padding-right: 42px;
        margin-bottom: 20px;
        text-align: center;
    }

    .clima-header-title h2 {
        font-size: 21px;
        line-height: 1.25;
    }

    .clima-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
        overflow: visible;
        padding-bottom: 0;
    }

    .clima-card {
        width: 100%;
        min-height: auto;
        box-sizing: border-box;
        padding: 18px;
    }

    .clima-icon-wrap {
        height: auto;
        margin: 18px 0 8px;
    }

    .clima-icon {
        width: 72px;
        height: 72px;
    }

    .clima-desc {
        margin-bottom: 24px;
    }

    .clima-temp {
        flex-wrap: wrap;
        line-height: 1.1;
    }

    .clima-temp-max {
        font-size: 38px;
    }

    .clima-temp-min {
        font-size: 26px;
    }

    .clima-hourly-btn {
        margin-top: 16px;
    }

    .clima-source {
        text-align: right;
        font-size: 12px;
        margin-top: 16px;
        padding-right: 0;
    }

    .clima-hourly-panel {
        margin-top: 24px;
        padding-top: 22px;
    }

    .clima-hourly-title {
        font-size: 20px;
        line-height: 1.25;
    }

    .clima-hourly-main {
        grid-template-columns: 62px 44px 80px 1fr 20px;
        gap: 8px;
        padding: 12px 10px;
    }

    .clima-hourly-time {
        font-size: 14px;
    }

    .clima-hourly-date {
        font-size: 12px;
    }

    .clima-hourly-img {
        width: 34px;
        height: 34px;
    }

    .clima-hourly-temp {
        font-size: 21px;
    }

    .clima-hourly-desc {
        font-size: 12px;
        letter-spacing: 2px;
        text-align: left;
    }

    .clima-hourly-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Logo superior del modal clima */
.clima-logo-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 22px;
    padding: 0 70px;
    box-sizing: border-box;
}

.clima-logo-header img {
    max-width: 520px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Ajuste del título después del logo */
.clima-header-title {
    text-align: center;
    margin-bottom: 28px;
    padding-right: 0;
}

.clima-header-title h2 {
    margin: 0;
    color: #963d56;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.2;
}

/* Móvil */
@media (max-width: 768px) {
    .clima-logo-header {
        padding: 0 48px 0 20px;
        margin-bottom: 18px;
    }

    .clima-logo-header img {
        max-width: 300px;
    }

    .clima-header-title {
        padding-right: 0;
        margin-bottom: 22px;
    }

    .clima-header-title h2 {
        font-size: 20px;
        line-height: 1.25;
    }
}