/* ResaCamino Weather Widget - v1.0.0 */

.rc-weather-widget {
    background: #ffffff;
    border: 1px solid rgba(39, 71, 105, 0.12);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a2e1c;
    box-sizing: border-box;
}
.rc-weather-widget *, .rc-weather-widget *::before, .rc-weather-widget *::after { box-sizing: border-box; }

.rc-weather-widget__loading,
.rc-weather-widget__error {
    text-align: center;
    padding: 30px 10px;
    color: #7a7a7a;
    font-size: 14px;
}
.rc-weather-widget__error { color: #c0392b; }

/* Header */
.rcw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}
.rcw-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #274769;
}
.rcw-header__sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6a7479;
}
.rcw-header__badge {
    font-size: 10px;
    color: #6a7479;
    background: #f2f4f7;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Current conditions */
.rcw-current {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
    padding: 12px 0 16px;
    border-bottom: 1px solid rgba(39, 71, 105, 0.1);
}
.rcw-current__main {
    display: flex;
    align-items: center;
    gap: 14px;
}
.rcw-current__icon { width: 72px; height: 72px; flex-shrink: 0; }
.rcw-current__temp { font-size: 42px; font-weight: 600; line-height: 1; color: #274769; }
.rcw-current__desc { margin: 4px 0 0; font-size: 13px; color: #6a7479; text-transform: capitalize; }
.rcw-current__details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 6px;
    column-gap: 20px;
    font-size: 13px;
}
.rcw-current__detail {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.rcw-current__detail-label { color: #6a7479; }
.rcw-current__detail-val { font-weight: 500; color: #1a2e1c; }

@media (max-width: 520px) {
    .rcw-current { grid-template-columns: 1fr; gap: 12px; }
    .rcw-current__details { grid-template-columns: repeat(2, 1fr); }
}

/* Hourly — scroll horizontal sur 24h */
.rcw-hourly { padding: 14px 0 10px; border-bottom: 1px solid rgba(39, 71, 105, 0.1); }
.rcw-section-title { margin: 0 0 10px; font-size: 12px; font-weight: 500; color: #6a7479; text-transform: uppercase; letter-spacing: 0.04em; }

.rcw-hourly__scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
    /* Scrollbar stylée */
    scrollbar-width: thin;
    scrollbar-color: rgba(39, 71, 105, 0.3) transparent;
}
.rcw-hourly__scroll::-webkit-scrollbar { height: 6px; }
.rcw-hourly__scroll::-webkit-scrollbar-track { background: transparent; }
.rcw-hourly__scroll::-webkit-scrollbar-thumb {
    background: rgba(39, 71, 105, 0.25);
    border-radius: 3px;
}
.rcw-hourly__scroll::-webkit-scrollbar-thumb:hover { background: rgba(39, 71, 105, 0.45); }

.rcw-hour {
    flex: 0 0 56px;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    scroll-snap-align: start;
}
.rcw-hour--now { background: #f4f7fb; }
.rcw-hour__label { font-size: 10px; color: #6a7479; font-weight: 500; white-space: nowrap; }
.rcw-hour__icon { width: 22px; height: 22px; margin: 4px auto; display: block; }
.rcw-hour__temp { font-size: 13px; font-weight: 500; color: #274769; }
.rcw-hour__pop { font-size: 9px; color: #185FA5; margin-top: 2px; min-height: 11px; white-space: nowrap; }

/* 5-day forecast */
.rcw-daily { padding: 14px 0 4px; }
.rcw-day {
    display: grid;
    grid-template-columns: 72px 32px 44px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 120ms ease;
}
.rcw-day:hover { background: #f4f7fb; }
.rcw-day--active { background: #E6F1FB; }
.rcw-day--active .rcw-day__label { color: #0C447C; font-weight: 600; }
.rcw-day:not(:last-child) { border-bottom: 1px solid rgba(39, 71, 105, 0.06); }
.rcw-day__label { font-size: 13px; color: #1a2e1c; }
.rcw-day__icon { width: 24px; height: 24px; }
.rcw-day__pop { font-size: 11px; color: #185FA5; text-align: center; }
.rcw-day__bar {
    position: relative;
    height: 4px;
    background: #eef1f4;
    border-radius: 2px;
}
.rcw-day__bar-fill {
    position: absolute;
    height: 4px;
    border-radius: 2px;
    background: #EF9F27;
}
.rcw-day__bar-fill--rainy { background: #85B7EB; }
.rcw-day__temps { font-size: 13px; text-align: right; }
.rcw-day__temp-min { color: #6a7479; }
.rcw-day__temp-max { font-weight: 600; color: #274769; }

@media (max-width: 520px) {
    .rcw-day { grid-template-columns: 60px 26px 36px minmax(0, 1fr) 62px; gap: 8px; }
    .rcw-day__label { font-size: 12px; }
}

/* Footer */
.rcw-footer {
    margin: 12px 0 0;
    font-size: 10px;
    color: #9a9fa3;
    text-align: right;
}

/* Teaser non-abonné */
.rcw-teaser {
    display: flex;
    align-items: center;
    gap: 16px;
}
.rcw-teaser__icon { width: 56px; height: 56px; flex-shrink: 0; }
.rcw-teaser__body { flex: 1; }
.rcw-teaser__title {
    display: block;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #274769;
    line-height: 1.3;
}
.rcw-teaser__desc { margin: 4px 0 10px; font-size: 13px; color: #6a7479; line-height: 1.4; }
.rcw-teaser__cta {
    background: #E6F1FB;
    color: #0C447C;
    border: 1px solid rgba(12, 68, 124, 0.2);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 120ms ease;
}
.rcw-teaser__cta:hover { background: #d7e7f7; color: #0C447C; }
.rcw-teaser__note { font-size: 11px; color: #9a9fa3; margin-left: 10px; }
.rcw-teaser__lock {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f2f4f7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Marqueurs Leaflet — z-index supérieur aux clusters (leaflet-enhancer les met à 2000 !important) */
.leaflet-marker-icon.rc-weather-marker-wrap {
    z-index: 2500 !important;
}
.rc-weather-marker {
    background: white !important;
    border: 1.5px solid #274769 !important;
    border-radius: 14px !important;
    padding: 3px 8px 3px 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rc-weather-marker__icon { width: 18px; height: 18px; }
.rc-weather-marker__temp { font-size: 12px; font-weight: 600; color: #274769; }

/* =========================================================================
 * Popup météo — SCOPÉ à .leaflet-popup.rc-weather-popup
 * N'affecte PAS les autres popups du site (hébergements, étapes, POI, etc.)
 * ========================================================================= */
.leaflet-popup.rc-weather-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.14);
    padding: 0;
}
.leaflet-popup.rc-weather-popup .leaflet-popup-content {
    margin: 0;
    padding: 12px 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a2e1c;
    line-height: 1.4;
}
.leaflet-popup.rc-weather-popup .leaflet-popup-close-button {
    top: 4px;
    right: 4px;
    padding: 4px 6px 0 0;
    color: #6a7479;
    font-size: 18px;
    font-weight: 400;
}
.leaflet-popup.rc-weather-popup .leaflet-popup-close-button:hover {
    color: #274769;
}
.leaflet-popup.rc-weather-popup .rc-weather-popup__title {
    font-size: 13px;
    font-weight: 600;
    color: #274769;
    margin: 0 18px 4px 0;
    line-height: 1.3;
}
.leaflet-popup.rc-weather-popup .rc-weather-popup__desc {
    font-size: 12px;
    color: #6a7479;
    margin: 0 0 8px;
    text-transform: capitalize;
    line-height: 1.3;
}
.leaflet-popup.rc-weather-popup .rc-weather-popup__details {
    font-size: 13px;
    color: #1a2e1c;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.leaflet-popup.rc-weather-popup .rc-weather-popup__details strong {
    color: #274769;
    font-weight: 600;
}
