/* --- VARIABLES & RESET --- */
:root {
    --primary-color: #002244; /* Azul Oscuro Profundo (Matriz) */
    --secondary-color: #ffffff; /* Blanco */
    --accent-color: #00509e; /* Azul más claro para interacciones */
    --text-color: #333333;
    --text-muted: #666666;
    --bg-color: #f4f6f9; /* Fondo gris muy claro */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --border-color: #e0e0e0;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --font-main: 'Inter', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- HEADER --- */
.main-header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%; /* Asegurar ancho completo */
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem; /* Padding horizontal */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; /* Ocupar toda la altura del padre */
    width: 100%;
}

.logo-text {
    font-size: 1.5rem; /* Logo más grande */
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.desktop-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
}

.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--secondary-color);
}

.nav-divider {
    color: rgba(255,255,255,0.3);
}

.user-info {
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-link-logout {
    border: 1px solid rgba(255,255,255,0.5);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

.nav-link-logout:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--secondary-color);
}

/* --- CARDS --- */
.card {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-color);
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: var(--font-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 80, 158, 0.1);
}

/* --- BUTTONS --- */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* --- TABLES --- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.95rem;
}

tr:hover td {
    background-color: #fafafa;
}

/* --- ALERTS --- */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

/* --- BADGES --- */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* --- DRAWER --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed;
    top: 0;
    right: -40%;
    width: 40%;
    height: 100%;
    background: #fff;
    box-shadow: -6px 0 14px rgba(0,0,0,0.08);
    border-left: 1px solid var(--border-color);
    transition: right 0.25s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.drawer.active { right: 0; }
.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    color: var(--primary-color);
}
.drawer-close {
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}
.drawer-body {
    padding: 16px 20px;
    overflow: visible;
}
.drawer-form-row.full { width: 100%; margin-bottom: 12px; }
.drawer-search-btn {
    width: 100%;
    background: #ff9f1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    height: 48px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.drawer-search-btn:hover {
    background: #ff7f00;
}

/* --- HOTEL SEARCH ROW --- */
.hotel-search-row {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1.2fr 0.8fr;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}
.hs-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 10px 12px;
}
.hs-box .form-label { margin-bottom: 6px; font-weight: 700; color: var(--primary-color); }
.hs-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hs-input {
    width: 100%;
    height: 40px;
    border: 1px solid #dce0e3;
    border-radius: 10px;
    padding: 8px 10px;
}
.hs-button {
    height: 54px;
    width: 100%;
    background: #ff9f1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}
.hs-button:hover { background: #ff7f00; }

/* --- POPOVERS --- */
.popover {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--hover-shadow);
    border-radius: 10px;
    padding: 12px;
    z-index: 1100;
}
.popover::-webkit-scrollbar { display: none; }
.popover { -ms-overflow-style: none; scrollbar-width: none; }
.guests-popover {
    width: 520px;
    max-width: min(520px, calc(100vw - 40px));
}
.guests-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.room-section { border: 1px dashed #ddd; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.room-title { font-weight: 800; color: var(--primary-color); margin-bottom: 8px; }
.ages-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.popover-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.btn-small { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #ddd; background: #f8f9fa; cursor: pointer; font-weight: 700; }
.btn-small.primary { background: #00509e; color: #fff; border-color: #004488; }

.range-popover { width: 320px; max-width: min(320px, calc(100vw - 40px)); }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* --- HOTEL RESULT CARD --- */
.hotel-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    position: relative;
}
.hotel-card:hover { box-shadow: var(--hover-shadow); transform: translateY(-1px); }
.hotel-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.hotel-stars { color: #ffcc00; font-size: 0.9rem; }
.hotel-price { font-weight: 800; color: var(--primary-color); }
.origin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
}
.origin-propio { background: #e6f4ea; color: #1e7e34; border: 1px solid #cfe9d6; }
.origin-banco { background: #fff4e5; color: #b75a00; border: 1px solid #ffe0b2; }

.sticky-search { position: sticky; top: 0; background: #fff; z-index: 1001; padding-bottom: 8px; margin-bottom: 12px; }
.sticky-search.stuck { box-shadow: 0 6px 12px rgba(0,0,0,0.06); }

@media (max-width: 1280px) {
    .hotel-search-row { grid-template-columns: 1.4fr 1.1fr 1.1fr 0.8fr; }
    .hs-input { height: 36px; font-size: 0.9rem; padding: 6px 8px; }
    .hs-button { height: 48px; font-size: 0.95rem; }
    .form-label { font-size: 0.9rem; }
}

@media (max-width: 1024px) {
    .hotel-search-row { grid-template-columns: 1fr 1fr; }
    .guests-popover { width: 440px; }
}

@media (max-width: 768px) {
    .hotel-search-row { grid-template-columns: 1fr; }
    .guests-popover, .range-popover { width: 100%; }
    .hs-button { width: 100%; }
}
/* --- MOBILE --- */
.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .mobile-menu {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100%;
        background-color: white;
        z-index: 2000;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        padding: 2rem;
        color: var(--text-color);
    }
    
    .mobile-menu.active {
        right: 0;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        font-weight: bold;
        font-size: 1.2rem;
    }

    .mobile-menu a {
        display: block;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-color);
        font-weight: 500;
    }
    
    .mobile-menu a:hover {
        color: var(--primary-color);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* --- LOGIN PAGE --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px); /* Restar altura del header */
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    border-top: 5px solid #00509e; /* Azul como en la imagen */
}

.login-header {
    margin-bottom: 2rem;
    text-align: left;
}

.login-title {
    font-size: 1.8rem;
    color: #333;
    font-weight: 400;
}

.btn-login {
    background-color: #D80073; /* Rosa/Fucsia */
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #a8005a;
}

.forgot-link {
    display: block;
    margin-top: 1rem;
    color: #00509e;
    font-size: 0.9rem;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #555;
}

/* --- DRAWER PANEL (HOTEL SEARCH) --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1500;
}
.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.drawer {
    position: fixed;
    top: 0;
    right: -40%;
    width: 40%;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 20px rgba(0,0,0,0.15);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease;
    border-left: 1px solid var(--border-color);
}
.drawer.active {
    right: 0;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--primary-color);
}
.drawer-close {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
}
.drawer-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}
.drawer-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.drawer-form-row .full {
    grid-column: 1 / -1;
}
.drawer-search-btn {
    background-color: #ffb400;
    color: #2c2c2c;
    font-weight: 800;
    border: none;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
}
.hotel-card {
    display: grid;
    grid-template-columns: 96px 1fr 120px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.hotel-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-1px);
}
.hotel-thumb {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
    background: #eee;
}
.hotel-stars {
    color: #f4c542;
}
.hotel-price {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: right;
}
.origin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}
.origin-propio {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}
.origin-banco {
    background-color: #ffe8cc;
    color: #8a5a00;
    border: 1px solid #ff9800;
}

/* --- HOTEL SEARCH ROW --- */
.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    height: 54px;
}
.search-box input {
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
    font-size: 1rem;
}
.search-box.active {
    border-color: #f4c542;
    box-shadow: 0 0 0 3px rgba(244,197,66,0.15);
}
.search-btn {
    background-color: #ffb400;
    color: #2c2c2c;
    font-weight: 800;
    border: none;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
}

/* --- GUESTS POPOVER --- */
.guest-popover {
    position: absolute;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--hover-shadow);
    padding: 12px;
    z-index: 1700;
    width: 520px;
    max-width: calc(100vw - 80px);
    display: none;
}
.guest-popover.active {
    display: block;
}
.guest-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.room-block {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
}
.room-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}
.age-selects {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
