@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700&display=swap');

/* =========================================
   VARIABLES GLOBALES (Esquema Light/Moderno)
   ========================================= */
:root {
    --bg-principal: #FFFFFF;
    --bg-secundario: #F8F9FA;
    --texto-oscuro: #0A0A0A;
    --texto-parrafo: #4A4A4A;
    --texto-muted: #868E96;
    --acento-morado: #6B21A8;
    --acento-morado-hover: #581C87;
    --acento-morado-claro: rgba(107, 33, 168, 0.08);
    --borde-sutil: #E9ECEF;
    --sombra-elegante: 0 10px 30px rgba(0, 0, 0, 0.04);
    --sombra-flotante: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* =========================================
   RESETEO Y TIPOGRAFÍA BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-principal);
    color: var(--texto-oscuro);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Outfit', sans-serif;
    color: var(--texto-oscuro);
    font-weight: 700;
}

/* =========================================
   CABECERA (HEADER)
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--borde-sutil);
}

.logo {
    font-size: 28px;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--texto-oscuro);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--acento-morado);
}

/* =========================================
   BOTONES
   ========================================= */
.btn-outline {
    border: 1px solid var(--texto-oscuro);
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--texto-oscuro);
    color: var(--bg-principal);
}

/* =========================================
   BUSCADOR CENTRAL (HERO STYLE TURO)
   ========================================= */
.hero-turo {
    padding: 30px 5%;
    background-color: var(--bg-principal);
}

.hero-turo-bg {
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 120px 20px 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    min-height: 480px;
    position: relative;
    overflow: hidden;
}

/* Oscurecer el fondo un poco para que el texto sea legible */
.hero-turo-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-turo-bg h1, .hero-turo-bg p, .search-widget-turo {
    position: relative;
    z-index: 2;
}

.hero-turo-bg h1 {
    font-size: 56px;
    margin-bottom: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1.5px;
}

.hero-turo-bg p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 40px;
    color: #fff;
}

.search-widget-turo {
    display: flex;
    background: #fff;
    border-radius: 50px;
    padding: 8px;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
    align-items: center;
}

.search-group-turo {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 10px 20px;
}

.search-group-where {
    flex: 1.5;
}

.search-group-datetime {
    flex: 2;
}

.search-group-turo label {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.search-group-turo input {
    border: none;
    background: transparent;
    font-size: 15px;
    color: #4a4a4a;
    outline: none;
    font-family: 'Inter', sans-serif;
    width: 100%;
    cursor: pointer;
}

.datetime-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dt-input {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

.dt-input input {
    font-size: 15px;
    text-overflow: ellipsis;
}

.dt-input .chevron-down {
    margin-left: 5px;
    display: flex;
    align-items: center;
    fill: #1a1a1a;
}

.search-group-divider {
    width: 1px;
    height: 40px;
    background-color: #e9ecef;
}

.search-group-button {
    padding: 0 8px;
}

.btn-search-round {
    background-color: #5A4FCF;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-search-round:hover {
    background-color: #4B41A8;
}

/* =========================================
   STICKY HEADER SEARCH
   ========================================= */
.header-search-mini {
    display: none;
    background: #fff;
    border-radius: 30px;
    padding: 6px 12px;
    border: 1px solid #e9ecef;
    align-items: center;
    cursor: pointer;
    margin-left: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.header-search-mini.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.header-search-mini span {
    font-size: 14px;
    font-weight: 500;
    color: #4a4a4a;
    margin-right: 12px;
    padding-left: 8px;
}

.header-search-mini .mini-divider {
    width: 1px;
    height: 16px;
    background-color: #ced4da;
    margin-right: 12px;
}

.header-search-mini .mini-search-icon {
    background-color: #5A4FCF;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-mini .mini-search-icon svg {
    stroke: #fff;
    width: 16px;
    height: 16px;
}

/* =========================================
   SECCIÓN DE INVENTARIO: CARRUSELES (NUEVO)
   ========================================= */
.featured-cars {
    padding: 40px 5% 80px 5%;
    background-color: var(--bg-principal);
}

.location-section {
    margin-bottom: 50px;
}

.location-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--texto-oscuro);
    font-weight: 700;
}

.car-carousel {
    display: grid;
    /* Por defecto: 5 Columnas */
    grid-auto-columns: calc((100% - 80px) / 5);
    grid-auto-flow: column;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    scrollbar-width: none; 
}

.car-carousel::-webkit-scrollbar {
    display: none; 
}

.car-card {
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    scroll-snap-align: start;
    position: relative;
}

.car-card:hover .car-image img {
    transform: scale(1.05);
}

.car-image {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: var(--bg-secundario);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Botón Corazón */
.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite svg {
    width: 26px;
    height: 26px;
    fill: rgba(0, 0, 0, 0.4);
    stroke: white;
    stroke-width: 1.5px;
    transition: fill 0.2s ease, transform 0.2s ease;
}

.btn-favorite:hover svg {
    transform: scale(1.1);
}

.btn-favorite.active svg {
    fill: #FF385C;
    stroke: #FF385C;
}

.car-info {
    text-align: left;
}

.car-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--texto-oscuro);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-price {
    color: var(--texto-oscuro);
    font-weight: 700;
    font-size: 15px;
}

.car-price span {
    color: var(--texto-muted);
    font-weight: 400;
}

/* =========================================
   FOOTER (ESTILO TURO)
   ========================================= */
.site-footer {
    background-color: #f8f9fa; /* Color de fondo sutil parecido al de Turo */
    padding: 60px 5% 40px 5%;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
    font-family: 'Inter', sans-serif;
}

.site-footer .footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer .footer-column {
    flex: 1;
    min-width: 140px;
}

.site-footer .footer-extras {
    flex: 1.5;
    min-width: 280px;
}

.site-footer .footer-column h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.site-footer .footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-column ul li {
    margin-bottom: 14px;
}

.site-footer .footer-column ul li a {
    text-decoration: none;
    color: #4a4a4a;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.site-footer .footer-column ul li a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

/* REDES SOCIALES */
.social-links {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links svg {
    width: 22px;
    height: 22px;
    fill: #1a1a1a;
    transition: opacity 0.2s;
}

.social-links a:hover svg {
    opacity: 0.7;
}

.blog-badge {
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.blog-badge:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* APP BUTTONS */
.app-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.app-btn {
    display: flex;
    align-items: center;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    gap: 10px;
    width: 140px;
    transition: opacity 0.2s;
}

.app-btn:hover {
    opacity: 0.85;
}

.app-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.app-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.app-btn-text span {
    font-size: 9px;
    line-height: 1;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.9);
}

.app-btn-text strong {
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
}

/* IDIOMA */
.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* BOTTOM FOOTER */
.site-footer .footer-bottom {
    display: flex;
    gap: 20px;
    align-items: center;
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding-top: 0;
    border-top: none;
    flex-wrap: wrap;
}

.site-footer .footer-bottom p {
    color: #717171;
    font-size: 12px;
    margin: 0;
    font-weight: 500;
}

.site-footer .footer-legal {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 20px;
    padding: 0;
    margin: 0;
}

.site-footer .footer-legal li:last-child {
    border-right: none;
}

.site-footer .footer-legal li a {
    text-decoration: none;
    color: #717171;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
}

.site-footer .footer-legal li a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .site-footer .footer-container {
        flex-direction: column;
    }
    .site-footer .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================
   MODAL DE INICIO DE SESIÓN
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-principal);
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: var(--sombra-flotante);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--texto-oscuro);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--acento-morado);
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 25px;
}

.form-group-modal {
    margin-bottom: 15px;
    text-align: left;
}

.form-group-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--texto-oscuro);
}

.form-group-modal input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--borde-sutil);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.form-group-modal input:focus {
    border-color: var(--acento-morado);
}

.btn-modal-primary {
    width: 100%;
    background-color: #5A4FCF;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-modal-primary:hover {
    background-color: var(--acento-morado-hover);
}

.modal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--texto-muted);
}

.modal-divider::before, .modal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--borde-sutil);
}

.modal-divider span {
    padding: 0 10px;
    font-size: 14px;
}

.btn-outline-modal {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--borde-sutil);
    color: var(--texto-oscuro);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-outline-modal:hover {
    background: var(--bg-secundario);
    border-color: var(--texto-oscuro);
}

/* =========================================
   MENÚ DESPLEGABLE DE USUARIO
   ========================================= */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 5px 5px 12px;
    border: 1px solid var(--borde-sutil);
    border-radius: 30px;
    background: transparent;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-menu-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #ddd;
}

.hamburger-icon {
    display: flex;
    align-items: center;
    color: var(--texto-oscuro);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-secundario);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-avatar {
    width: 100%;
    height: 100%;
    background-color: var(--texto-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.empty-avatar svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

.user-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background: var(--bg-principal);
    border: 1px solid var(--borde-sutil);
    border-radius: 12px;
    box-shadow: var(--sombra-flotante);
    width: 240px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px 20px;
    background: var(--bg-secundario);
    font-size: 14px;
    color: var(--texto-oscuro);
}

.user-dropdown hr {
    border: 0;
    border-top: 1px solid var(--borde-sutil);
    margin: 0;
}

.user-dropdown a {
    padding: 12px 20px;
    color: var(--texto-oscuro);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}

.user-dropdown a:hover {
    background-color: var(--bg-secundario);
    color: var(--acento-morado);
}

.dropdown-logout {
    color: var(--estado-error) !important;
}

.dropdown-logout:hover {
    background-color: #ffeef0 !important;
}

/* =========================================
   SELECTOR DE IDIOMA (FOOTER)
   ========================================= */
.language-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
    font-weight: 500;
}

.language-selector:hover {
    background: rgba(0,0,0,0.05);
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--bg-principal);
    border: 1px solid var(--borde-sutil);
    border-radius: 12px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    min-width: 160px;
    padding: 10px 0;
    z-index: 100;
    margin-bottom: 8px; /* Separación visual */
}

/* Puente invisible para mantener el hover activo en el espacio en blanco */
.language-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 15px;
}

.language-selector:hover .language-dropdown {
    display: flex;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--texto-oscuro);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.language-dropdown a:hover {
    background: var(--bg-secundario);
}

.language-dropdown img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%;
}

/* =========================================
   RESPONSIVO (MEDIA QUERIES AL FINAL SIEMPRE)
   ========================================= */
@media (max-width: 1024px) {
    .car-carousel {
        /* Tablet: 4 Columnas */
        grid-auto-columns: calc((100% - 60px) / 4);
    }
}

@media (max-width: 768px) {
    .car-carousel {
        /* Móvil: 2 Columnas */
        grid-auto-columns: calc((100% - 20px) / 2);
    }
    .search-widget {
        flex-direction: column;
        border-radius: 16px;
        padding: 15px;
    }
    .search-group {
        border-right: none;
        border-bottom: 1px solid var(--borde-sutil);
        padding: 15px 5px;
    }
    .search-group:last-child {
        border-bottom: none;
        padding-top: 20px;
    }
    .btn-search {
        padding: 15px;
    }
    nav ul {
        display: none; 
    }
}