/* ============================================================
   ARRECIFES — Coastal Sophistication Design System
   Style Sheet
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Colors */
    --color-primary: #243443;
    --color-primary-light: #0e1f2d;
    --color-surface: #fcf9f0;
    --color-surface-dim: #dcdad1;
    --color-surface-container: #f0eee5;
    --color-surface-container-low: #f6f4eb;
    --color-surface-container-high: #eae8df;
    --color-surface-container-highest: #e4e3da;
    --color-surface-container-lowest: #ffffff;
    --color-secondary: #7295B7;
    --color-secondary-container: #b4d8fd;
    --color-secondary-dark: #3e6181;
    --color-on-primary: #ffffff;
    --color-on-surface: #1b1c17;
    --color-on-surface-variant: #43474c;
    --color-secondary-fixed-dim: #a7caee;
    --color-outline: #74777c;
    --color-outline-variant: #c4c6cc;
    --color-cream: #F4F2E9;

    /* Shadows — ambient, using primary navy tint */
    --shadow-ambient: 0px 12px 32px rgba(36, 52, 67, 0.06);
    --shadow-elevated: 0px 20px 48px rgba(36, 52, 67, 0.10);
    --shadow-deep: 0px 32px 64px rgba(36, 52, 67, 0.14);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base Reset ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Manrope', system-ui, sans-serif;
    background-color: var(--color-surface);
    color: var(--color-on-surface);
    overflow-x: hidden;
}

::selection {
    background-color: rgba(114, 149, 183, 0.30);
}

/* ---------- Glassmorphism Nav ---------- */
.glass-nav {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-nav.scrolled {
    box-shadow: var(--shadow-ambient);
}

/* ---------- Logo ---------- */
.logo-container {
    padding: 0;
}

.logo-img {
    filter: brightness(0) saturate(100%) invert(16%) sepia(21%) saturate(1512%) hue-rotate(169deg) brightness(94%) contrast(90%);
}

.footer-logo .logo-img {
    filter: brightness(0) invert(1);
}

/* ---------- Nav Links ---------- */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-secondary);
    transition: width 0.4s var(--ease-out-expo);
}

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

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

/* ---------- Mobile Menu ---------- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(14, 31, 45, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease-out-expo);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-cream);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo), color 0.3s ease;
}

.mobile-menu.open a {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.3s; }

.mobile-menu a:hover {
    color: var(--color-secondary);
}

/* ---------- Hamburger Button ---------- */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 110;
    position: relative;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background-color: var(--color-primary);
    transition: all 0.4s var(--ease-out-expo);
    position: absolute;
}

.hamburger span:first-child { transform: translateY(-6px); }
.hamburger span:last-child { transform: translateY(6px); }

.hamburger.active span {
    background-color: var(--color-cream);
}

.hamburger.active span:first-child {
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:last-child {
    transform: rotate(-45deg);
}

/* ---------- Close Button (mobile menu) ---------- */
.mobile-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 120;
    transition: transform 0.3s ease;
}

.mobile-close-btn:hover {
    transform: rotate(90deg);
}

/* ---------- Hero ---------- */
.hero-gradient {
    background: linear-gradient(135deg, rgba(14, 31, 45, 0.85) 0%, rgba(14, 31, 45, 0.4) 50%, transparent 100%);
}

.hero-content {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 1s var(--ease-out-expo) 0.3s forwards;
}

.hero-stats {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1s var(--ease-out-expo) 0.6s forwards;
}

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

/* ---------- Scroll-based Reveal Animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }

/* ---------- Parallax Hero Image & Zoom ---------- */
.parallax-bg {
    will-change: transform;
    transition: transform 0.1s linear;
}

.hero-zoom-wrapper {
    animation: zoomOut 25s ease-in-out infinite alternate;
    width: 100%;
    height: 100%;
}

@keyframes zoomOut {
    0% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---------- Feature Cards ---------- */
.feature-card {
    transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-elevated);
}

/* ---------- Bento Grid Cards ---------- */
.bento-card {
    transition: transform 0.5s var(--ease-out-expo), box-shadow 0.4s ease;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.bento-card img {
    transition: transform 0.8s var(--ease-out-expo);
}

.bento-card:hover img {
    transform: scale(1.05);
}

/* ---------- Animated Progress Bar ---------- */
.progress-bar-fill {
    width: 0;
    transition: width 1.5s var(--ease-out-expo);
}

.progress-bar-fill.animate {
    width: 23%;
}

/* ---------- Ping / Pulse Location ---------- */
@keyframes locationPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(2.5); opacity: 0; }
}

.location-pulse {
    animation: locationPulse 2s ease-in-out infinite;
}

/* ---------- Counter Animation ---------- */
.counter {
    display: inline-block;
}

/* (CTA Skew removed per request) */

/* ---------- Floating Action Button ---------- */
.fab-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    z-index: 90;
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
    opacity: 0;
    transform: scale(0) translateY(20px);
}

.fab-whatsapp.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.fab-whatsapp:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.45);
}

.fab-whatsapp svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* ---------- Form Inputs ---------- */
.form-input {
    background-color: var(--color-surface-container);
    border: 1px solid transparent;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    width: 100%;
    font-family: 'Manrope', sans-serif;
    font-size: 0.875rem;
    color: var(--color-on-surface);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--color-outline);
}

.form-input:focus {
    background-color: var(--color-surface-container-highest);
    border-color: rgba(196, 198, 204, 0.15);
    box-shadow: 0 0 0 3px rgba(114, 149, 183, 0.12);
}

/* ---------- CTA Button Shine Effect ---------- */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ---------- Section Divider Wave ---------- */
.wave-divider {
    position: relative;
    overflow: hidden;
}

.wave-divider::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--color-surface);
    clip-path: ellipse(55% 100% at 50% 0%);
    z-index: 2;
}

/* ---------- Image Overlay on Hover ---------- */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.8s var(--ease-out-expo);
}

.image-hover-zoom:hover img {
    transform: scale(1.08);
}

/* ---------- Proximity Card Glass ---------- */
.proximity-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    transition: background 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.proximity-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(6px);
}

/* ---------- Tooltip ---------- */
.tooltip {
    position: relative;
}

/* ---------- Footer ---------- */
.footer-link {
    transition: color 0.3s ease, opacity 0.3s ease;
}

.footer-link:hover {
    color: var(--color-secondary) !important;
    opacity: 1 !important;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface-container-low);
}

::-webkit-scrollbar-thumb {
    background: var(--color-outline-variant);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-outline);
}

/* ---------- Loading Skeleton ---------- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---------- Masterplan Interactivo ---------- */
#masterplan-container {
    position: relative;
    padding: 2rem;
    background-color: var(--color-surface-container-low);
    overflow: hidden;
}

@media (min-width: 1024px) {
    #masterplan-container { padding: 4rem; }
}

.masterplan-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* The actual interactive paths */
.lote-path {
    fill: rgba(212, 175, 55, 0.15); /* Sutil dorado para disponibles */
    stroke: rgba(255,255,255,0.2);
    stroke-width: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Interaction by Status */
.status-disponible {
    fill: rgba(212, 175, 55, 0.15);
}

.status-disponible:hover {
    fill: rgba(212, 175, 55, 0.5);
    stroke: #D4AF37;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.8));
}

.status-vendido {
    fill: rgba(186, 26, 26, 0.15); /* Sutil rojo para vendidos */
    cursor: not-allowed;
}

.status-vendido:hover {
    fill: rgba(186, 26, 26, 0.4);
    stroke: #ba1a1a;
}

.status-reservado {
    fill: rgba(161, 130, 74, 0.2); /* Sutil café para reservados */
}

.status-reservado:hover {
    fill: rgba(161, 130, 74, 0.5);
    stroke: #A1824A;
}

/* ---------- Gallery Interaction Hardening ---------- */
#main-gallery-img {
    pointer-events: none;
}

#main-prev,
#main-next,
.thumb-item {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem !important;
        line-height: 1.05;
    }

    .section-heading {
        font-size: 2rem !important;
    }

    .mobile-menu a {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem !important;
    }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
