/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    padding-top: 80px;
    padding-bottom: 80px;
}

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

/* Header Fijo */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.header-fixed .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.logo .subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.4);
    background: #c0392b;
}

/* Animaciones */
.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease-in 0.3s both;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease-in 0.6s both;
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Secciones */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* Apartamentos */
.apartamentos-section {
    background: var(--bg-light);
}

.apartamento-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.apartamento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.apartamento-card:nth-child(even) {
    direction: rtl;
}

.apartamento-card:nth-child(even) > * {
    direction: ltr;
}

.apartamento-image {
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

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

.apartamento-card:hover .apartamento-image img {
    transform: scale(1.1);
}

.apartamento-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apartamento-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.apartamento-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.features-list {
    list-style: none;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--text-dark);
    font-weight: 500;
}

/* Tarifas */
.tarifas-section {
    background: var(--white);
}

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

.tarifa-card {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.tarifa-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tarifa-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tarifa-desc {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.tarifa-nota {
    font-weight: 600;
    color: var(--secondary-color);
}

.tarifa-link {
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    cursor: pointer;
}

.tarifa-link:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
    text-decoration: underline;
}

.tarifa-contacto {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Contacto */
.contacto-section {
    background: var(--bg-light);
}

.contacto-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.contacto-item h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contacto-item a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}

.contacto-item a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.contacto-item p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Botón WhatsApp Flotante */
.whatsapp-float {
    position: fixed;
    bottom: 70px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* Footer Fijo */
.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.6rem 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.6rem;
}

.footer-fixed p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-fixed a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-fixed a:hover {
    color: var(--white);
    text-decoration: underline;
}

.login-link {
    margin-left: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.5rem;
}

.footer-text-desktop {
    display: inline;
}

.footer-text-mobile {
    display: none;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close-modal:hover {
    color: var(--accent-color);
}

#loginForm input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-lighter);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

#loginForm input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

#loginForm button {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#loginForm button:hover {
    background: var(--primary-color);
}

/* Editor de contenido */
.editable {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.editable:hover {
    background: rgba(52, 152, 219, 0.1);
    outline: 2px dashed var(--secondary-color);
    outline-offset: 4px;
}

.editable::after {
    content: '✏️';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
}

.editable:hover::after {
    opacity: 1;
}

.edit-field {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-lighter);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.edit-field:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.edit-image-container {
    margin-bottom: 1.5rem;
}

.edit-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.edit-image-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border-lighter);
    border-radius: 8px;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-save, .btn-cancel {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-save {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-save:hover {
    background: var(--primary-color);
}

.btn-cancel {
    background: var(--text-light);
    color: var(--white);
}

.btn-cancel:hover {
    background: var(--accent-color);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Galería Modal */
.modal-gallery {
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item .delete-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.95);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    transition: var(--transition);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item .delete-image:hover {
    background: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gallery-item .delete-image:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.gallery-add-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bg-light);
}

.gallery-add-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.gallery-add-section input {
    margin-bottom: 1rem;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
}

.file-upload-label:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.file-upload-input {
    display: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .apartamento-card {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .apartamento-card:nth-child(even) {
        direction: ltr;
    }

    .apartamento-image {
        min-height: 300px;
    }

    .apartamento-content {
        padding: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .whatsapp-float {
        bottom: 60px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    body {
        padding-bottom: 120px;
    }

    .footer-fixed {
        font-size: 0.55rem;
        padding: 0.5rem 0.4rem;
    }

    .footer-fixed p {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
        font-size: 0.55rem;
        white-space: normal;
        line-height: 1.3;
        max-height: none;
        overflow: visible;
        justify-content: center;
        align-items: center;
    }

    .login-link {
        font-size: 0.5rem;
        white-space: nowrap;
        margin-left: 0.3rem;
    }

    .footer-text-desktop {
        display: none;
    }

    .footer-text-mobile {
        display: inline;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .logo .subtitle {
        font-size: 0.75rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn-primary {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
}

