/* ===========================
   VARIABLES Y CONFIGURACIÓN
   =========================== */

:root {
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --accent-color: #06b6d4;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-radius: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESET
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===========================
   NAVBAR
   =========================== */

.navbar {
    background-color: var(--bg-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#inicio, #propiedades, #autos, #contacto {
    scroll-margin-top: 100px;
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.logo-container:hover {
    transform: translateY(-2px);
}

.logo-img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.2);
    border: 2px solid var(--secondary-color);
    transition: var(--transition);
}

.logo-container:hover .logo-img {
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.25);
    transform: scale(1.05);
}

.logo-container h1 {
    color: var(--primary-color);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 48px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
    font-size: 15px;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--secondary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.btn-contacto {
    background-color: var(--secondary-color) !important;
    color: var(--bg-white) !important;
    padding: 11px 28px !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 700;
}

.btn-contacto:hover {
    background-color: var(--secondary-dark) !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.2);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 101;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 6px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===========================
   BOTONES
   =========================== */

.btn {
    display: inline-block;
    padding: 13px 32px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2.5px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-4px);
}

.btn-small {
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
}

.btn-detalles {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-detalles:hover {
    background-color: var(--primary-light);
}

.btn-whatsapp {
    background-color: #25d366 !important;
    color: white !important;
}

.btn-whatsapp:hover {
    background-color: #1fa84a !important;
}

/* ===========================
   LANDING
   =========================== */

.landing {
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a52 50%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.landing-background {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><linearGradient id="grad" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.1);stop-opacity:1" /><stop offset="100%25" style="stop-color:rgba(255,255,255,0);stop-opacity:1" /></linearGradient></defs><rect width="1200" height="600" fill="url(%23grad)"/><circle cx="600" cy="300" r="250" fill="rgba(245,158,11,0.05)"/><circle cx="150" cy="150" r="180" fill="rgba(6,182,212,0.04)"/><circle cx="1050" cy="450" r="200" fill="rgba(245,158,11,0.03)"/></svg>');
    opacity: 1;
}

.landing-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--bg-white);
    max-width: 750px;
    margin: 0 auto;
    animation: slideDown 0.8s ease;
}

.landing-content h1 {
    font-size: 64px;
    font-weight: 900;
    margin-bottom: 18px;
    letter-spacing: -1.5px;
    line-height: 1.2;
}

.landing-content p {
    font-size: 20px;
    margin-bottom: 16px;
    opacity: 0.96;
    font-weight: 500;
}

.landing-buttons {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===========================
   PROPIEDADES / AUTOS
   =========================== */

.propiedades,
.autos {
    padding: 120px 0;
}

.propiedades {
    background-color: var(--bg-light);
}

.autos {
    background-color: var(--bg-white);
}

.propiedades h2,
.autos h2 {
    text-align: center;
    font-size: 48px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
    margin-bottom: 60px;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 70px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 28px;
    border: 2.5px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    font-size: 15px;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.propiedades-grid,
.autos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.propiedad-card,
.auto-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.propiedad-card:hover,
.auto-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

.propiedad-image,
.auto-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.propiedad-image img,
.auto-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.propiedad-card:hover .propiedad-image img,
.auto-card:hover .auto-image img {
    transform: scale(1.08);
}

.propiedad-tipo {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--secondary-color);
    color: var(--bg-white);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
}

.propiedad-info,
.auto-info {
    padding: 28px;
}

.propiedad-info h3,
.auto-info h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.ubicacion,
.auto-marca {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
}

.propiedad-detalles,
.auto-detalles {
    font-size: 14px;
    color: var(--text-light);
    margin: 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.precio {
    font-size: 22px;
    font-weight: 900;
    color: var(--secondary-color);
    margin: 16px 0;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
    text-align: center;
}

/* ===========================
   MODAL
   =========================== */

#modal-detalles {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#modal-detalles.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 48px;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary-color);
    transform: scale(1.2);
}

.modal-content h2 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.modal-content p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.modal-close-btn {
    margin-top: 24px;
    width: 100%;
}

/* ===========================
   FOOTER
   =========================== */

footer {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ===========================
   ADMIN PANEL
   =========================== */

#admin-area {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

#admin-area.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

body.admin-open {
    overflow: hidden;
}

.admin-panel {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.admin-panel h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 900;
}

#admin-login-form,
#admin-ctl {
    display: none;
}

#admin-ctl.show {
    display: block;
}

.admin-form-group {
    margin-bottom: 24px;
}

.admin-form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.admin-buttons .btn {
    flex: 1;
}

#admin-list {
    background-color: var(--bg-light);
    padding: 24px;
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 30px;
}

.admin-item {
    background-color: var(--bg-white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-item-title {
    font-weight: 600;
    color: var(--primary-color);
}

#admin-login-error {
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ===========================
   REVEAL ANIMATIONS
   =========================== */

.reveal-element {
    opacity: 0;
    transform: translateY(30px);
}

.reveal-element.revealed {
    animation: revealIn 0.8s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes revealIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .navbar-container {
        height: 70px;
    }

    .logo-container h1 {
        font-size: 24px;
    }

    .nav-menu ul {
        gap: 20px;
    }

    .nav-menu a {
        font-size: 14px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        z-index: 99;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-menu a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .landing-content h1 {
        font-size: 42px;
    }

    .landing-content p {
        font-size: 16px;
    }

    .propiedades h2,
    .autos h2 {
        font-size: 36px;
    }

    .propiedades-grid,
    .autos-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 32px;
        width: 95%;
    }

    .admin-panel {
        padding: 24px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        height: 60px;
    }

    .logo-container h1 {
        display: none;
    }

    .landing-content h1 {
        font-size: 32px;
    }

    .landing-content p {
        font-size: 14px;
    }

    .landing-buttons {
        flex-direction: column;
    }

    .landing-buttons .btn {
        width: 100%;
    }

    .propiedades h2,
    .autos h2 {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .filter-buttons {
        margin-bottom: 40px;
    }

    .propiedades-grid,
    .autos-grid {
        gap: 16px;
    }

    .btn-group {
        flex-direction: column;
    }

    .modal-content {
        padding: 20px;
    }

    .admin-panel {
        padding: 16px;
    }
}

