/**
 * =============================================================================
 * PASAPORTE RURAL by rutasrurales.io — Hoja de estilos del módulo
 * =============================================================================
 * Colores corporativos del proyecto:
 *   --primary:   #2F5233 (verde oscuro)
 *   --secondary: #6B8E6B (verde medio)
 *   --accent:    #B8956A (marrón/dorado rural)
 *   --dark:      #1A2E1A (casi negro verdoso)
 *
 * Este archivo se usa en: mi-pasaporte.php y validar_pasaporte.php
 * =============================================================================
 */

/* ── Variables CSS ──────────────────────────────────────────────────────────── */
:root {
    --p-primary:     #2F5233;
    --p-secondary:   #6B8E6B;
    --p-accent:      #B8956A;
    --p-dark:        #1A2E1A;
    --p-light-bg:    #f4f7f4;
    --p-card-bg:     #ffffff;
    --p-border:      #d4e0d4;
    --p-focus-ring:  rgba(47, 82, 51, 0.25);
    --p-success-bg:  #d4edda;
    --p-error-bg:    #f8d7da;
    --p-gold:        #c9a84c;
}

/* ── Reset y base ──────────────────────────────────────────────────────────── */
body.pasaporte-body {
    background-color: var(--p-light-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--p-dark);
    min-height: 100vh;
}

/* ── Cabecera del módulo ────────────────────────────────────────────────────── */
.pasaporte-header {
    background: linear-gradient(135deg, var(--p-primary) 0%, var(--p-secondary) 100%);
    color: #fff;
    padding: 2rem 1.5rem 1.75rem;
    text-align: center;
    border-radius: 0 0 1.5rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 20px rgba(47, 82, 51, 0.25);
}

.pasaporte-header .logo-pasaporte {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.pasaporte-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}

.pasaporte-header .subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
}

/* ── Tarjeta principal del pasaporte digital ───────────────────────────────── */
.pasaporte-card {
    background: var(--p-card-bg);
    border: 1px solid var(--p-border);
    border-radius: 1.25rem;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 20px rgba(47, 82, 51, 0.10);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Línea decorativa superior */
.pasaporte-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--p-primary), var(--p-accent), var(--p-secondary));
}

/* ── Información del turista dentro del pasaporte ─────────────────────────── */
.turista-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--p-primary);
    box-shadow: 0 2px 8px rgba(47, 82, 51, 0.25);
    flex-shrink: 0;
}

.turista-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    border: 3px solid var(--p-primary);
    box-shadow: 0 2px 8px rgba(47, 82, 51, 0.25);
    flex-shrink: 0;
}

.turista-nombre {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--p-dark);
    margin: 0 0 0.15rem;
}

.turista-email {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}

/* ── Badge de nivel ─────────────────────────────────────────────────────────── */
.nivel-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-top: 6px;
}

/* ── Estadísticas del pasaporte (puntos, descuento, sellos) ──────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: var(--p-light-bg);
    border: 1px solid var(--p-border);
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.stat-valor {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--p-primary);
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

/* ── Badge de descuento destacado ──────────────────────────────────────────── */
.descuento-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--p-accent) 0%, #d4a864 100%);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 900;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(184, 149, 106, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* ── Contenedor QR ──────────────────────────────────────────────────────────── */
.qr-wrapper {
    background: #fff;
    border: 2px solid var(--p-border);
    border-radius: 1rem;
    padding: 1.25rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 12px rgba(47, 82, 51, 0.10);
    transition: opacity 0.3s ease;
}

/* Efecto fade durante la actualización del QR */
.qr-wrapper.actualizando {
    opacity: 0.4;
}

#qr-canvas {
    display: block;
}

.qr-label {
    font-size: 0.72rem;
    color: #6c757d;
    text-align: center;
    margin: 0;
    font-weight: 600;
}

/* ── Barra de progreso del contador QR ─────────────────────────────────────── */
.qr-timer-wrap {
    margin-top: 0.75rem;
    width: 100%;
}

.qr-timer-label {
    font-size: 0.75rem;
    color: var(--p-primary);
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.35rem;
    display: block;
}

.qr-progress-bar-bg {
    height: 6px;
    background: var(--p-border);
    border-radius: 3px;
    overflow: hidden;
}

.qr-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--p-primary), var(--p-accent));
    border-radius: 3px;
    transition: width 1s linear;
    width: 100%;
}

/* Color de advertencia cuando quedan pocos segundos */
.qr-progress-bar-fill.urgente {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

/* ── Indicador de estado del QR (activo / cargando) ───────────────────────── */
.qr-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.qr-status.activo  { color: #198754; }
.qr-status.cargando { color: var(--p-accent); }
.qr-status.error    { color: #dc3545; }

.dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ── Instrucciones para el propietario (mini-guía en el pasaporte) ─────────── */
.instrucciones-card {
    background: #f0f7f0;
    border: 1px solid #c3dcc3;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.instrucciones-card h3 {
    color: var(--p-primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.instrucciones-card ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.82rem;
    color: #4a6a4a;
}

.instrucciones-card ol li {
    margin-bottom: 0.25rem;
}

/* ── Historial de sellos (mini-timeline) ────────────────────────────────────── */
.sellos-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sello-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--p-border);
}

.sello-item:last-child {
    border-bottom: none;
}

.sello-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: #fff;
}

.sello-info {
    flex: 1;
    min-width: 0;
}

.sello-alojamiento {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-dark);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sello-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
}

.sello-puntos {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-primary);
    flex-shrink: 0;
}

/* ── Vista de validación (propietario) ──────────────────────────────────────── */

/* Pantalla de éxito — fondo verde */
.validacion-ok {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e9 100%);
    border: 2px solid var(--p-secondary);
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.validacion-ok::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--p-primary), var(--p-accent));
}

.validacion-ok .check-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0%   { transform: scale(0.4); opacity: 0; }
    80%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}

.validacion-ok h2 {
    color: var(--p-primary);
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.validacion-ok .turista-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    flex-wrap: wrap;
}

/* Pantalla de error — fondo rojo */
.validacion-error {
    background: linear-gradient(135deg, #f8d7da 0%, #ffebee 100%);
    border: 2px solid #f5c6cb;
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.validacion-error::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #dc3545;
}

.validacion-error .error-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

.validacion-error h2 {
    color: #721c24;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}

.validacion-error p {
    color: #721c24;
    font-size: 0.9rem;
    margin: 0;
}

/* ── Formulario de puntuación con estrellas ──────────────────────────────────── */
.rating-group {
    margin-bottom: 1.25rem;
}

.rating-group label.rating-titulo {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-dark);
    margin-bottom: 0.5rem;
}

.stars-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.stars-input input[type="radio"] {
    display: none;
}

.stars-input label {
    font-size: 2rem;
    cursor: pointer;
    color: #d4d4d4;
    transition: color 0.15s ease, transform 0.1s ease;
    line-height: 1;
}

/* Colorear estrellas: al hover o al seleccionar */
.stars-input label:hover,
.stars-input label:hover ~ label,
.stars-input input:checked ~ label {
    color: var(--p-gold);
}

.stars-input label:hover {
    transform: scale(1.15);
}

/* ── Botón de sello ─────────────────────────────────────────────────────────── */
.btn-sellar {
    background: linear-gradient(135deg, var(--p-primary) 0%, var(--p-secondary) 100%);
    color: #fff;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sellar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 82, 51, 0.35);
}

.btn-sellar:active {
    transform: translateY(0);
}

.btn-sellar:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Pantalla de confirmación tras el sello ─────────────────────────────────── */
.sello-confirmado {
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sello-confirmado .sello-stamp {
    font-size: 5rem;
    display: block;
    margin-bottom: 0.75rem;
    animation: stampIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampIn {
    0%   { transform: scale(3) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* ── Progreso hacia el próximo descuento ────────────────────────────────────── */
.progreso-descuento {
    background: var(--p-light-bg);
    border: 1px solid var(--p-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.progreso-descuento .progreso-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--p-primary);
    margin-bottom: 0.5rem;
}

.progreso-bar-bg {
    height: 10px;
    background: var(--p-border);
    border-radius: 5px;
    overflow: hidden;
}

.progreso-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--p-primary), var(--p-accent));
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Footer del módulo ──────────────────────────────────────────────────────── */
.pasaporte-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #8a9a8a;
    padding: 1.5rem 0 2.5rem;
}

.pasaporte-footer strong {
    color: var(--p-primary);
}

/* ── Spinner de carga ───────────────────────────────────────────────────────── */
.spinner-rural {
    width: 36px;
    height: 36px;
    border: 3px solid var(--p-border);
    border-top-color: var(--p-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .pasaporte-header {
        border-radius: 0 0 1rem 1rem;
        padding: 1.5rem 1rem 1.25rem;
    }

    .pasaporte-card {
        padding: 1.25rem 1rem;
        border-radius: 1rem;
    }

    .stats-grid {
        gap: 0.5rem;
    }

    .stat-valor {
        font-size: 1.25rem;
    }

    .stars-input label {
        font-size: 1.65rem;
    }

    .validacion-ok,
    .validacion-error {
        padding: 1.5rem 1rem;
    }
}


/* =============================================================================
   SECCIÓN: ALOJAMIENTOS PREMIUM CON DESCUENTO
   ============================================================================= */

/* ── Contenedor principal de la sección ──────────────────────────────────────── */
.premium-section {
    background: var(--p-card-bg);
    border: 1px solid var(--p-border);
    border-radius: 1.25rem;
    padding: 1.5rem 1.25rem 1.25rem;
    box-shadow: 0 4px 20px rgba(47, 82, 51, 0.10);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Línea decorativa superior (igual que pasaporte-card) */
.premium-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--p-accent), var(--p-primary), var(--p-secondary));
}

/* ── Cabecera: título + toggle ────────────────────────────────────────────────── */
.premium-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.premium-titulo {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--p-primary);
    margin: 0 0 0.2rem;
}

.premium-titulo .fa-star {
    color: var(--p-gold);
}

.premium-subtitulo {
    font-size: 0.78rem;
    color: #6c757d;
    margin: 0;
}

.premium-subtitulo strong {
    color: var(--p-accent);
    font-weight: 700;
}

/* ── Toggle Tarjetas / Mapa ───────────────────────────────────────────────────── */
.premium-toggle {
    display: flex;
    border: 1.5px solid var(--p-border);
    border-radius: 0.6rem;
    overflow: hidden;
    flex-shrink: 0;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.toggle-btn:first-child {
    border-right: 1.5px solid var(--p-border);
}

.toggle-btn:hover {
    background: var(--p-light-bg);
    color: var(--p-primary);
}

.toggle-btn.active {
    background: var(--p-primary);
    color: #fff;
}

.toggle-btn.active:hover {
    background: var(--p-dark);
}

/* ── Skeleton de carga ────────────────────────────────────────────────────────── */
.alo-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alo-skeleton-card {
    height: 88px;
    background: linear-gradient(
        90deg,
        var(--p-light-bg) 25%,
        #e8efe8 50%,
        var(--p-light-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 0.85rem;
    border: 1px solid var(--p-border);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Listado de alojamientos ──────────────────────────────────────────────────── */
.alo-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Tarjeta individual de alojamiento ────────────────────────────────────────── */
.alo-card {
    display: flex;
    align-items: stretch;
    background: var(--p-light-bg);
    border: 1px solid var(--p-border);
    border-radius: 0.9rem;
    overflow: hidden;
    /* Override Bootstrap link color */
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    min-height: 88px;
}

.alo-card:hover,
.alo-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 82, 51, 0.18);
    border-color: var(--p-secondary);
    text-decoration: none !important;
    color: inherit !important;
    outline: 2px solid var(--p-focus-ring);
    outline-offset: 2px;
}

/* Todos los elementos dentro de .alo-card heredan color, nunca azul */
.alo-card * {
    color: inherit;
}

/* ── Foto de la tarjeta ───────────────────────────────────────────────────────── */
.alo-card-foto {
    /* Ancho fijo, altura = altura de la tarjeta (stretch) */
    flex: 0 0 88px;    /* grow=0, shrink=0, basis=88px */
    width: 88px;
    align-self: stretch;
    background-color: var(--p-border);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    /* Sin height explícito: la altura la dicta el cuerpo de la tarjeta */
}

/* fallback si se usa <img> en lugar de background-image */
.alo-card-foto img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.alo-foto-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--p-secondary);
}

/* ── Badge Premium (sobre la foto) ─────────────────────────────────────────────── */
.alo-badge-premium {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--p-gold);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 2;
    letter-spacing: 0.03em;
}

/* ── Cuerpo de la tarjeta ─────────────────────────────────────────────────────── */
.alo-card-body {
    flex: 1;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.alo-nombre {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-dark);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alo-ubicacion {
    font-size: 0.72rem;
    color: #6c757d;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alo-ubicacion .fa-location-dot {
    color: var(--p-secondary);
}

.alo-tipo {
    font-size: 0.70rem;
    color: var(--p-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.4rem;
}

/* ── Bloque de precios ────────────────────────────────────────────────────────── */
.alo-precio-bloque {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Precio original tachado */
.alo-precio-original {
    font-size: 0.75rem;
    color: #adb5bd;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    font-weight: 500;
}

/* Contenedor del precio con descuento + /noche */
.alo-precio-dto-wrap {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

/* Precio con descuento — protagonista */
.alo-precio-dto {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--p-primary);
    line-height: 1;
}

.alo-por-noche {
    font-size: 0.68rem;
    color: #6c757d;
    font-weight: 500;
}

/* Badge "tu descuento -X%" */
.alo-ahorro-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #a5d6a7;
    white-space: nowrap;
}

/* Sin precio */
.alo-sin-precio {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

/* CTA → "Ver alojamiento" */
.alo-cta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--p-accent);
    margin-top: 0.25rem;
    display: block;
}

/* ── Estado vacío / error ─────────────────────────────────────────────────────── */
.alo-error,
.alo-vacio {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.alo-error {
    color: #dc3545;
}

.alo-vacio-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

/* ── Mapa Leaflet ─────────────────────────────────────────────────────────────── */
.premium-mapa {
    width: 100%;
    height: 340px;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--p-border);
    background: var(--p-light-bg);
}

/* Leyenda debajo del mapa */
.mapa-leyenda {
    font-size: 0.73rem;
    color: #6c757d;
    text-align: center;
    margin: 0.5rem 0 0;
}

.mapa-leyenda-pin {
    margin-right: 3px;
}

/* ── Pines personalizados del mapa (DivIcon) ─────────────────────────────────── */
.mapa-pin-precio {
    background: var(--p-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(47, 82, 51, 0.5);
    position: relative;
    font-family: 'Segoe UI', system-ui, sans-serif;
    letter-spacing: -0.01em;
    transition: transform 0.15s ease;
    cursor: pointer;
}

/* Flechita inferior del pin */
.mapa-pin-precio::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--p-primary);
    border-bottom: none;
}

.mapa-pin-precio:hover {
    transform: scale(1.1) translateY(-1px);
    background: var(--p-dark);
}

/* ── Popup del mapa ───────────────────────────────────────────────────────────── */
.mapa-popup {
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-width: 180px;
    max-width: 230px;
}

.mapa-popup-foto {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 0.6rem;
}

.mapa-popup-nombre {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p-dark);
    margin: 0 0 2px;
    line-height: 1.2;
}

.mapa-popup-ubicacion {
    font-size: 0.72rem;
    color: #6c757d;
    margin: 0 0 0.5rem;
}

/* Bloque de precios dentro del popup */
.mapa-popup-precios {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    background: #f0f7f0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
}

.mapa-popup-orig {
    font-size: 0.72rem;
    color: #adb5bd;
    text-decoration: line-through;
}

.mapa-popup-dto {
    font-size: 1rem;
    font-weight: 800;
    color: var(--p-primary);
    line-height: 1;
}

.mapa-popup-dto small {
    font-size: 0.65rem;
    font-weight: 500;
    color: #6c757d;
    margin-left: 1px;
}

.mapa-popup-ahorro {
    font-size: 0.62rem;
    background: #d4edda;
    color: #155724;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}

/* Botón "Ver alojamiento" dentro del popup */
.mapa-popup-btn {
    display: block;
    background: var(--p-primary);
    color: #fff;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
    margin-top: 0.25rem;
}

.mapa-popup-btn:hover {
    background: var(--p-dark);
    color: #fff;
    text-decoration: none;
}

/* Corregir z-index de popups de Leaflet para que aparezcan sobre la UI */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(47, 82, 51, 0.25) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0.75rem !important;
    width: auto !important;
}

.leaflet-popup-tip {
    background: #fff !important;
}

/* =============================================================================
   TARJETA: FOOTER DE BOTONES + FORMULARIO DE RESERVA
   ============================================================================= */

/* Wrapper que contiene la tarjeta + el formulario desplegable */
.alo-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Footer de la tarjeta: "Ver alojamiento" + "Solicitar reserva" ─────────── */
.alo-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Botón "Ver alojamiento" — link discreto */
.btn-ver-alo {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--p-accent) !important;
    text-decoration: none !important;
    padding: 3px 0;
    gap: 3px;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.btn-ver-alo:hover {
    color: var(--p-primary) !important;
    text-decoration: none !important;
}

/* Separador visual entre los dos botones */
.btn-ver-alo + .btn-reserva::before {
    content: '·';
    margin-right: 0.5rem;
    color: var(--p-border);
    font-weight: 400;
}

/* Botón "Solicitar reserva" — verde subtle */
.btn-reserva {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--p-primary);
    background: transparent;
    border: none;
    padding: 3px 0;
    cursor: pointer;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.btn-reserva:hover {
    color: var(--p-accent);
}

/* Estado activo (formulario abierto) */
.btn-reserva.activo {
    color: var(--p-accent);
}

/* ── Formulario de reserva inline ─────────────────────────────────────────── */
.reserva-form-wrap {
    margin-top: 0;
    border-radius: 0 0 0.9rem 0.9rem;
    overflow: hidden;
    border: 1px solid var(--p-border);
    border-top: none;
    background: #f0f7f0;
}

.reserva-form {
    padding: 0.9rem 1rem;
}

.reserva-form-titulo {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--p-primary);
    margin: 0 0 0.35rem;
}

.reserva-form-info {
    font-size: 0.74rem;
    color: #5a7a5a;
    margin: 0 0 0.65rem;
    background: #fff;
    border: 1px solid #c3dcc3;
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
}

.reserva-form-info strong {
    color: var(--p-primary);
}

/* Textarea del mensaje */
.reserva-mensaje {
    width: 100%;
    border: 1.5px solid var(--p-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--p-dark);
    background: #fff;
    resize: vertical;
    min-height: 72px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.reserva-mensaje:focus {
    outline: none;
    border-color: var(--p-primary);
    box-shadow: 0 0 0 3px var(--p-focus-ring);
}

.reserva-mensaje::placeholder {
    color: #adb5bd;
}

/* Fila de botones del form */
.reserva-form-btns {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

/* Botón enviar */
.btn-enviar-reserva {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--p-primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-enviar-reserva:hover:not(:disabled) {
    background: var(--p-dark);
    transform: translateY(-1px);
}

.btn-enviar-reserva:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Botón cancelar */
.btn-cancelar-reserva {
    background: transparent;
    color: #6c757d;
    border: 1.5px solid var(--p-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-cancelar-reserva:hover {
    background: #fff;
    color: var(--p-dark);
}

/* Mensajes de respuesta */
.reserva-respuesta {
    margin-top: 0.6rem;
}

.reserva-ok {
    background: #d4edda;
    border: 1px solid #b8dabc;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    color: #155724;
    font-weight: 500;
}

.reserva-ok small {
    display: block;
    margin-top: 3px;
    opacity: 0.8;
}

.reserva-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    color: #721c24;
    font-weight: 500;
}
/* ── Responsive: premium section (ajustes para móviles pequeños) ── */
@media (max-width: 480px) {
    /* Convertir tarjeta a layout vertical */
    .alo-card {
        flex-direction: column;
    }

    /* La foto ahora ocupa el ancho completo y tiene una altura fija */
    .alo-card-foto {
        flex-basis: 120px; /* Altura de la imagen */
        width: 100%;
        height: 120px;
        border-bottom: 1px solid var(--p-border);
    }

    /* El cuerpo de la tarjeta ya no necesita justificar el contenido */
    .alo-card-body {
        justify-content: flex-start;
        padding: 0.75rem 0.8rem;
    }

    .alo-nombre {
        font-size: 0.95rem; /* Un poco más grande para destacar */
    }
}

/* ── Responsive: premium section (SOLO ajustes que no conflictan con las reglas base) ── */
@media (max-width: 600px) {

    .premium-section {
        padding: 1rem 0.85rem 0.9rem;
        border-radius: 1rem;
    }

    .toggle-btn {
        font-size: 0.68rem;
        padding: 0.38rem 0.55rem;
    }

    /* Tarjeta: sigue en HORIZONTAL, la foto ya tiene triple lock 88×88 */
    /* Solo reducimos el padding del cuerpo para dar más aire al texto */
    .alo-card-body {
        padding: 0.55rem 0.7rem;
    }

    /* Nombre: permite wrap en 2 líneas si es largo */
    .alo-nombre {
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.25;
        margin-bottom: 2px;
    }

    /* Ubicación: idem */
    .alo-ubicacion {
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
    }

    /* Bloque de precios: permite salto de línea si no cabe todo */
    .alo-precio-bloque {
        row-gap: 3px;
    }

    /* Badge de ahorro: ligeramente más pequeño */
    .alo-ahorro-badge {
        font-size: 0.58rem;
        padding: 2px 4px;
    }

    .premium-mapa {
        height: 250px;
    }
}
