:root {
    --primary: #2C4A3B;
    /* Deep Forest Green */
    --secondary: #E36414;
    /* Warm Terra-cotta */
    --accent: #F4A261;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #2A9D8F;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
    color: white;
}

.navbar.scrolled {
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.host-nav-link {
    font-weight: 700 !important;
    color: inherit !important;
    transition: color 0.3s ease, transform 0.2s ease;
}

.host-nav-link:hover {
    color: var(--secondary) !important;
}

.navbar.scrolled .host-nav-link {
    color: var(--text-main) !important;
}

.navbar.scrolled .host-nav-link:hover {
    color: var(--primary) !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-badge {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s;
}

.language-selector:hover {
    color: var(--secondary);
}

.notifications {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.notifications:hover {
    transform: scale(1.1);
}

.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.host-btn {
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.3s;
}

.host-btn:hover {
    color: var(--secondary);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.8rem;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.gamification-points {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.navbar.scrolled .profile-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.profile-btn i {
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    height: 85vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../images/fondo_desierto.webp');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.6));
}

.offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    width: 100%;
    max-width: 900px;
    padding: 0 2rem;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Search Bar */
.search-bar {
    background-color: var(--card-bg);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    color: var(--text-main);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: left;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-bar:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.search-field {
    flex: 1;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: 30px;
    transition: background 0.2s;
}

.search-field:hover {
    background-color: #F3F4F6;
}

.search-field label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    cursor: pointer;
}

.search-field input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    width: 100%;
    min-width: 0;
}

.search-field input::placeholder {
    color: var(--text-muted);
}

.search-divider {
    width: 1px;
    height: 30px;
    background-color: var(--border);
    margin: 0 0.5rem;
}



.search-btn {
    background-color: var(--secondary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.search-btn:hover {
    background-color: #c0520e;
    transform: scale(1.05);
}

/* ── Wrapper principal sidebar + contenido ── */
.listings-wrapper {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 80px);
}

/* ── Sidebar de categorías (izquierda) ── */
.cat-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: white;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 1rem 0 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.cat-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem 0.4rem;
    margin: 0;
}

.cat-sidebar-group {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.9rem 1.2rem 0.2rem;
    margin: 0;
    opacity: 0.6;
}

.category-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    width: 100%;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.category-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.category-item span {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item:hover {
    background: var(--bg);
    color: var(--text-main);
}

.category-item.active {
    color: var(--primary);
    background: rgba(44, 74, 59, 0.07);
    border-left-color: var(--primary);
    font-weight: 700;
}

.category-item.active i {
    color: var(--primary);
}

/* ── Contenido a la derecha del sidebar ── */
.listings-main {
    flex: 1;
    min-width: 0;
}

/* Listings Grid */
.listings-container {
    padding: 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.8rem;
}

/* ── Responsive: ocultar sidebar en móvil ── */
@media (max-width: 768px) {
    .cat-sidebar {
        display: none;
    }
    .listings-container {
        padding: 1.5rem 1rem;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

.listing-card {
    cursor: pointer;
    background: var(--card-bg);
    border-radius: 15px;
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Staggered animation */
.listing-card:nth-child(1) {
    animation-delay: 0.1s;
}

.listing-card:nth-child(2) {
    animation-delay: 0.2s;
}

.listing-card:nth-child(3) {
    animation-delay: 0.3s;
}

.listing-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.eco-badge {
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.discount-badge {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: #ef4444;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.1);
    color: white;
}

.favorite-btn.active {
    color: #FF5A5F;
}

.listing-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem;
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.listing-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.location {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.details {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.book-now-btn {
    margin-top: 0.5rem;
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.book-now-btn:hover {
    background-color: #1a2e24;
}

/* Floating Map Button */
.floating-map-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: transform 0.3s, background 0.3s;
}

.floating-map-btn:hover {
    transform: translateX(-50%) scale(1.05);
    background: black;
}



/* Responsive */
@media (max-width: 1024px) {
    .navbar { padding: 0.8rem 2rem; }
    .hero-title { font-size: 3rem; }
    .search-bar {
        flex-direction: column;
        border-radius: 20px;
        padding: 1.2rem;
        gap: 0.8rem;
        width: 90%;
        margin: 0 auto;
    }
    .search-divider { display: none; }
    .search-field { 
        width: 100%; 
        border: 1px solid var(--border); 
        border-radius: 12px;
        padding: 0.6rem 1rem;
    }
    .search-btn { width: 100%; border-radius: 12px; height: 48px; margin-top: 0.5rem; }
}

@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; }
    .logo span { display: none; }
    .nav-links { display: none; }
    .hero { 
        height: auto; 
        min-height: 100vh; 
        padding-top: 120px;
        padding-bottom: 60px;
        display: flex;
        align-items: center;
    }
    .hero-content { transform: none; padding: 0 1rem; }
    .hero-title { font-size: 2.2rem; line-height: 1.2; margin-bottom: 1rem; }
    .hero-subtitle { font-size: 1.1rem; margin-bottom: 2rem; }
    .listings-container { padding: 1.5rem 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .profile-btn span, .gamification-points { display: none; }
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 250px;
    padding: 1rem 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--border);
    color: var(--text-main);
    text-align: left;
}

.profile-dropdown.show {
    display: flex;
}

.dropdown-item {
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--bg-color);
}

.dropdown-item.danger {
    color: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.mobile-only-link {
    display: none !important;
}

@media (max-width: 768px) {
    .dropdown-item.mobile-only-link {
        display: flex !important;
    }
    .dropdown-divider.mobile-only-link {
        display: block !important;
    }
}

.dropdown-header {
    padding: 0 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.dropdown-header strong {
    display: block;
    font-size: 1.05rem;
}

.dropdown-header span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
/* -- TOAST NOTIFICATIONS (Compact, Unobtrusive & Modern) -- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
    z-index: 99999;
    pointer-events: none;
    max-width: min(400px, calc(100vw - 32px));
}
.toast {
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: max-content;
    max-width: 100%;
    pointer-events: auto;
}
.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.toast.hide {
    transform: translateY(15px) scale(0.95);
    opacity: 0;
}
.toast.error { border-color: rgba(239, 68, 68, 0.45); background: rgba(28, 17, 23, 0.96); color: #fecaca; }
.toast.success { border-color: rgba(16, 185, 129, 0.45); background: rgba(12, 28, 22, 0.96); color: #d1fae5; }
.toast.info { border-color: rgba(56, 189, 248, 0.45); background: rgba(15, 23, 42, 0.96); color: #e0f2fe; }
.toast i { font-size: 1.15rem; flex-shrink: 0; }
.toast.error i { color: #f87171; }
.toast.success i { color: #34d399; }
.toast.info i { color: #38bdf8; }

/* ── REGLAS RESPONSIVE GLOBALES AVANZADAS (Móviles & Tablets) ── */
@media (max-width: 480px) {
    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        align-items: center;
        max-width: calc(100vw - 32px);
    }
    .toast {
        padding: 9px 16px;
        font-size: 0.85rem;
        border-radius: 50px;
        justify-content: center;
        text-align: center;
    }
    .modal-content {
        width: 95vw !important;
        padding: 1.2rem !important;
        border-radius: 16px !important;
    }
    .hero-title {
        font-size: 1.8rem !important;
    }
    .hero-subtitle {
        font-size: 0.95rem !important;
    }
    .search-bar {
        width: 95% !important;
        padding: 1rem !important;
    }
    .search-field input {
        font-size: 0.9rem !important;
    }
}
