/**
 * Termales Booking System - Public Styles
 * Version: 1.0.0
 */

:root {
    --termales-primary: #2d7a5f;
    --termales-primary-dark: #1f5a42;
    --termales-secondary: #f8f9fa;
    --termales-border: #e5e7eb;
    --termales-text: #333;
    --termales-text-light: #666;
}

/* ============================================
   MOTOR DE BÚSQUEDA
   ============================================ */

.termales-search-widget {
    background: rgba(255, 255, 255, 0.98);
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 1200px;
    margin: 0 auto;
}

.search-title {
    text-align: center;
    margin-bottom: 30px;
}

.search-title h2 {
    color: var(--termales-primary);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.search-title p {
    color: var(--termales-text-light);
    font-size: 14px;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    align-items: flex-end;  /* Alinea todos los campos + botón en la base */
}

.search-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;  /* Botón alineado al fondo igual que inputs */
}

.search-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--termales-text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.date-selector {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--termales-border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.date-selector:hover,
.date-selector.active {
    border-color: var(--termales-primary);
    box-shadow: 0 2px 8px rgba(45, 122, 95, 0.15);
}

.month-badge {
    background: linear-gradient(135deg, var(--termales-primary) 0%, var(--termales-primary-dark) 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    margin-right: 12px;
    letter-spacing: 0.5px;
}

.date-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    color: var(--termales-text);
    font-weight: 500;
    cursor: pointer;
    background: transparent;
}

.calendar-icon {
    font-size: 20px;
    color: #6b7280;
}

.guests-selector {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--termales-border);
    border-radius: 8px;
    padding: 14px;
    gap: 12px;
}

.guests-selector:hover {
    border-color: var(--termales-primary);
}

.guest-icon,
.child-icon {
    font-size: 20px;
}

.guest-input {
    width: 45px;
    border: 1px solid var(--termales-border);
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 5px;
    outline: none;
    transition: border-color 0.3s;
}

.guest-input:focus {
    border-color: var(--termales-primary);
}

.promo-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--termales-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-weight: 500;
}

.promo-input:focus {
    border-color: var(--termales-primary);
    box-shadow: 0 2px 8px rgba(45, 122, 95, 0.15);
}

.btn-reservar {
    width: 100%;
    background: linear-gradient(135deg, var(--termales-primary) 0%, var(--termales-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0 28px;
    height: 54px;          /* Igual que los inputs de fecha y huéspedes */
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    box-shadow: 0 4px 14px rgba(45, 122, 95, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-reservar:hover {
    background: linear-gradient(135deg, #236149 0%, #184a34 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(45, 122, 95, 0.45);
}

.btn-reservar:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 122, 95, 0.25);
}

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

/* ============================================
   CALENDARIO MODAL
   ============================================ */

.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.calendar-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calendar-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

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

.calendar-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.calendar-month h3 {
    text-align: center;
    color: var(--termales-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-header {
    display: contents;
}

.calendar-header div {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    padding: 12px 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day,
.calendar-day-empty {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day-empty {
    background: transparent;
    cursor: default;
}

.calendar-day {
    background: white;
    border: 2px solid var(--termales-border);
    color: #374151;
}

.calendar-day:not(.disabled):hover {
    background: #f0fdf4;
    border-color: var(--termales-primary);
    transform: scale(1.05);
}

.calendar-day.disabled {
    opacity: 0.3;
    text-decoration: line-through;
    cursor: not-allowed;
    color: #9ca3af;
}

.calendar-day.checkin,
.calendar-day.checkout {
    background: var(--termales-primary);
    color: white;
    border-color: var(--termales-primary);
    font-weight: 700;
}

.calendar-day.in-range {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.close-calendar {
    width: 100%;
    background: #6b7280;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-calendar:hover {
    background: #4b5563;
}

/* ============================================
   RESULTADOS DE BÚSQUEDA
   ============================================ */

.termales-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h2 {
    font-size: 32px;
    color: var(--termales-text);
    margin-bottom: 15px;
}

.results-count {
    color: var(--termales-text-light);
    font-size: 16px;
}

.room-card {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.room-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.room-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.room-title {
    font-size: 26px;
    color: var(--termales-text);
    font-weight: 700;
    margin-bottom: 15px;
}

.room-description {
    color: var(--termales-text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.room-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--termales-text);
}

.feature-icon {
    font-size: 18px;
}

.room-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--termales-border);
}

.price-info {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 13px;
    color: var(--termales-text-light);
    margin-bottom: 5px;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--termales-primary);
}

.price-nights {
    font-size: 12px;
    color: var(--termales-text-light);
}

.btn-book-room {
    background: var(--termales-primary);
    color: white;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-book-room:hover {
    background: var(--termales-primary-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .termales-search-widget {
        padding: 25px;
    }
    
    .calendar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .calendar-content {
        padding: 25px;
    }
    
    .room-card {
        grid-template-columns: 1fr;
    }
    
    .room-image {
        height: 220px;
    }
    
    .room-pricing {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn-book-room {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.termales-loading {
    pointer-events: none;
    opacity: 0.6;
}

.termales-loading .btn-reservar::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

/* ============================================
   UTILITIES
   ============================================ */

.termales-hide {
    display: none !important;
}

.termales-show {
    display: block !important;
}

.termales-text-center {
    text-align: center;
}

.termales-mb-20 {
    margin-bottom: 20px;
}

.termales-mt-20 {
    margin-top: 20px;
}
