/* ===== METEO BOXES ===== */
.reg-meteo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid;
    aspect-ratio: 1;
    min-width: 62px;
    text-align: center;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .reg-meteo {
        aspect-ratio: auto;
        padding: 0.6rem 0.9rem;
        min-width: 90px;
    }
}

/* Cards con flecha direccional */
@media (max-width: 639px) {
    .reg-meteo-con-flecha {
        aspect-ratio: auto;
        min-width: 74px;
        align-items: stretch;
    }
    .reg-meteo-con-flecha .reg-meteo-title {
        text-align: center;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        padding-bottom: 0.18rem;
        margin-bottom: 0.2rem;
    }
    .reg-meteo-body {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }
    .reg-meteo-data {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
    }
    .reg-meteo-con-flecha .flecha-dir {
        width: 23px;
        height: 23px;
        flex-shrink: 0;
    }
}
@media (min-width: 640px) {
    .reg-meteo-body { display: contents; }
    .reg-meteo-data { display: contents; }
}
.reg-meteo-title {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.reg-meteo-value {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}
.reg-meteo-unit {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.15rem;
    line-height: 1.2;
}

/* ===== STAR RATINGS ===== */
.star-rating {
    display: inline-flex;
    gap: 2px;
    cursor: pointer;
}
.star-rating .star {
    color: #d1d5db;
    font-size: 1.4rem;
    line-height: 1;
    transition: color 0.1s;
    user-select: none;
}
.star-rating .star.activa {
    color: #f59e0b;
}
.star-rating .star.hover {
    color: #fbbf24;
}
/* Read-only stars (small) */
.stars-ro {
    color: #f59e0b;
    font-size: 0.85rem;
    letter-spacing: -1px;
}
.stars-ro .empty {
    color: #d1d5db;
}

/* ===== NAV MOBILE ===== */
#nav-mobile {
    display: none;
}
#nav-mobile.open {
    display: block;
}

/* ===== GALLERY ===== */
.gallery-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}
.gallery-scroll img,
.gallery-scroll video {
    height: 110px;
    width: auto;
    max-width: 200px;
    border-radius: 0.375rem;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
    transition: border-color 0.15s;
}
.gallery-scroll img:hover,
.gallery-scroll video:hover {
    border-color: #3b82f6;
}
.gallery-video-thumb {
    position: relative;
    height: 110px;
    width: auto;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: border-color 0.15s;
}
.gallery-video-thumb:hover { border-color: #3b82f6; }
.gallery-video-thumb video {
    height: 100%;
    width: auto;
    max-width: 200px;
    object-fit: cover;
    display: block;
    border: none;
}
.gallery-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ===== ARROW DIRECTION ===== */
.flecha-dir {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

/* ===== CARD RECORD ===== */
.card-registro {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.card-registro:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== FORM SECTIONS ===== */
.form-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}
.form-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
    display: block;
}
.form-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
    color: #1e293b;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ===== PLACE CARD ===== */
.card-lugar {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.15s, transform 0.15s;
}
.card-lugar:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* ===== PAGINATION ===== */
.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    text-decoration: none;
    transition: all 0.1s;
}
.pag-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}
.pag-btn.activa {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* ===== LIGHTBOX ===== */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#lightbox.open {
    display: flex;
}
#lightbox img, #lightbox video {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 0.5rem;
    object-fit: contain;
}
#lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}

/* ===== TIDE BAR (lista) ===== */
.marea-lista { background:#eef2ff; border:1px solid #c7d2fe; border-radius:8px; padding:6px 10px 9px; min-width:140px; display:flex; flex-direction:column; }
.marea-lista-header { display:flex; justify-content:space-between; align-items:baseline; }
.marea-lista-indice { font-weight:700; font-size:0.85rem; color:#3730a3; font-variant-numeric:tabular-nums; }
.marea-lista-dir { font-weight:400; font-size:0.7rem; margin-left:2px; }
/* 3× width in forms */
.marea-lista--form { min-width: 200px; }
@media (min-width: 640px) {
    .marea-lista--form { min-width: 270px; }
}

/* ===== MISC ===== */
.badge-lluvia {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
}
.texto-sesion {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}
.texto-sesion.completo {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

/* ===== TAB BAR MÓVIL ===== */
.tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 10px 6px 12px;
    font-size: 1.45rem;
    line-height: 1;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 6px;
    margin: 5px 3px;
    transition: background 0.15s, color 0.15s;
}
.tab-item:hover { background: rgba(255,255,255,0.08); }
.tab-item--activa { background: rgba(96,165,250,0.18); border-top: 2px solid #60a5fa; padding-top: 8px; color: #fff; }

/* Padding inferior del main en móvil para no quedar bajo la tab bar */
@media (max-width: 639px) {
    .pb-safe-mobile { padding-bottom: var(--tab-bar-h, 5rem); }
    #tab-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Card agua: ancho fijo para que el error no expanda la línea */
.reg-meteo--agua {
    width: 66px;
    overflow: hidden;
}
@media (min-width: 640px) {
    .reg-meteo--agua {
        width: 90px;
    }
}

/* ===== MOBILE CARDS (registrar/mar) ===== */
.mob-card {
    border: 1px solid #e9eff6;
    border-radius: 1rem;
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.mob-card--col {
    flex-direction: column;
    justify-content: center;
    min-height: 96px;
    gap: 0;
}
.mob-card--marea {
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-height: 78px;
}
.mob-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.2;
    margin-top: 0.2rem;
}
.mob-card-sublabel {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 0.1rem;
}
.mob-spin {
    width: 14px;
    height: 14px;
    border: 2px solid #bfdbfe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.mob-err {
    font-size: 0.65rem;
    font-weight: 700;
    color: #dc2626;
    cursor: pointer;
    text-decoration: underline;
    flex-shrink: 0;
}
/* Marker con flecha en la mini-barra de marea */
.mob-marea-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 9px;
    background: #1e293b;
    border: 1.5px solid white;
    border-radius: 50%;
    overflow: visible;
    z-index: 1;
}
.mob-marea-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
}
.mob-marea-marker--sub::after {
    left: calc(100% + 2px);
    border-left: 7px solid #0288d1;
    border-right-width: 0;
}
.mob-marea-marker--baj::after {
    right: calc(100% + 2px);
    border-right: 7px solid #e67043;
    border-left-width: 0;
}
