/* Custom CSS for Costa Mira Mactan */

/* Root Variables */
:root {
    --primary-color: #1B365D;
    --secondary-color: #F7931E;
    --accent-color: #FFD700;
    --dark-color: #212529;
    --gray-light: #f8fafc;
    --gray-medium: #6b7280;
    --white: #ffffff;
    
    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: #374151;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Typography */
.font-playfair {
    font-family: var(--font-heading);
}

.font-inter {
    font-family: var(--font-primary);
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    transition: var(--transition);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(27, 54, 93, 0.3);
}

/* Navigation Styles */
#navbar {
    transition: var(--transition);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    transition: var(--transition);
}

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

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

/* Mobile Navigation Styles */
@media (max-width: 767px) {
    /* Prevent horizontal overflow on mobile */
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Container constraints */
    .container {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Show mobile menu button */
    .md\\:hidden {
        display: block !important;
    }
    
    /* Hide desktop menu */
    .hidden.md\\:flex {
        display: none !important;
    }
    
    /* Mobile menu button styling */
    #navbar button {
        padding: 0.5rem;
        border-radius: 0.5rem;
        transition: background-color 0.3s ease;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
    }
    
    /* Navigation container mobile fix */
    #navbar .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #navbar .flex {
        width: 100%;
        max-width: 100%;
    }
    
    /* Logo container mobile fix */
    #navbar .flex.items-center.space-x-3 {
        flex-shrink: 1;
        min-width: 0;
    }
    
    #navbar .flex.items-center.space-x-3 img {
        max-width: 120px;
        height: auto;
    }
    
    #navbar button:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    #navbar button i {
        font-size: 1.5rem;
        color: #374151;
    }
    
    /* Mobile menu styling */
    #mobileMenu {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.98);
    }
    
    #mobileMenu.hidden {
        display: none !important;
    }
    
    #mobileMenu:not(.hidden) {
        display: block !important;
    }
    
    /* Mobile menu links */
    #mobileMenu a {
        padding: 0.75rem 0;
        transition: color 0.3s ease, background-color 0.3s ease;
        border-radius: 0.5rem;
        margin-bottom: 0.25rem;
        display: block;
    }
    
    #mobileMenu a:hover {
        color: var(--primary-color);
        background-color: rgba(27, 54, 93, 0.05);
    }
    
    #mobileMenu a:last-child {
        margin-top: 1rem;
        background-color: var(--primary-color);
        color: white !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    
    #mobileMenu a:last-child:hover {
        background-color: #0f2a47;
        color: white !important;
    }
    
    /* Additional mobile viewport fixes */
    * {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Prevent any element from causing horizontal overflow */
    img, video, iframe, embed, object {
        max-width: 100%;
        height: auto;
    }
    
    /* Section padding fixes for mobile */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Container fixes */
    .container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 768px) {
    /* Ensure desktop menu is visible */
    .hidden.md\\:flex {
        display: flex !important;
    }
    
    /* Hide mobile elements */
    .md\\:hidden {
        display: none !important;
    }
}

/* Hero Section */
#hero {
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(27, 54, 93, 0.7) 0%, rgba(37, 99, 235, 0.5) 100%);
    z-index: 10;
}

/* Parallax Effect for Hero Background */
#hero img {
    transform: scale(1.1);
    animation: parallaxMove 20s ease-in-out infinite;
}

@keyframes parallaxMove {
    0%, 100% { transform: scale(1.1) translateY(0px); }
    50% { transform: scale(1.15) translateY(-10px); }
}

/* Section Spacing */
section {
    padding: 80px 0;
}

@media (min-width: 1024px) {
    section {
        padding: 120px 0;
    }
}

/* Card Hover Effects */
.card-hover {
    transition: var(--transition-slow);
    cursor: pointer;
}

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

/* Feature Cards */
.feature-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition-slow);
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.feature-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(27, 54, 93, 0.3);
}

/* Gallery Styles */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition-slow);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    transition: var(--transition-slow);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox Styles */
#lightbox {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

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

#lightboxImage {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Form Styles */
.form-input {
    transition: var(--transition);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.1);
    outline: none;
}

.form-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    transition: var(--transition);
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-button:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(27, 54, 93, 0.3);
}

/* Contact Cards */
.contact-card {
    transition: var(--transition);
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 1.5rem;
}

.contact-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats Counter Animation */
.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Success/Error Messages */
.message-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

.message-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .font-playfair {
        font-size: 2.5rem !important;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 3rem;
        line-height: 1.2;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
}

/* Hero Section - Comprehensive Responsive Design */
#hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Hero Height Optimization */
@media (max-width: 768px) {
    #hero {
        min-height: 70vh;
        min-height: 70dvh;
        height: 70vh;
        height: 70dvh;
        max-height: 600px;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
    }
    
    /* Hero content mobile fixes - White space principles */
    .hero-content {
        padding: 2rem 1.5rem !important;
        max-width: 100% !important;
        text-align: center;
        width: 100%;
        margin-bottom: 4rem !important;
    }
    
    /* Hero text spacing improvements */
    .hero-content h1 {
        margin-bottom: 1.5rem !important;
        line-height: 1.2 !important;
        font-size: 2rem !important;
    }
    
    .hero-content p {
        margin-bottom: 0 !important;
        line-height: 1.6 !important;
        font-size: 1rem !important;
        opacity: 0.9;
    }
    
    /* Hero buttons mobile positioning - Single row with white space */
    .hero-buttons {
        position: absolute !important;
        bottom: 2.5rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 3rem) !important;
        max-width: 320px !important;
        z-index: 30 !important;
    }
    
    .hero-buttons .flex {
        flex-direction: row !important;
        gap: 1rem !important;
        justify-content: space-between !important;
    }
    
    .hero-buttons a {
        flex: 1 !important;
        justify-content: center !important;
        padding: 0.625rem 0.875rem !important;
        font-size: 0.8rem !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        font-weight: 500 !important;
        letter-spacing: 0.025em !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 480px) {
    #hero {
        min-height: 60vh;
        min-height: 60dvh;
        height: 60vh;
        height: 60dvh;
        max-height: 500px;
        width: 100vw;
        max-width: 100vw;
    }
    
    .hero-buttons {
        bottom: 2rem !important;
        width: calc(100% - 2.5rem) !important;
        max-width: 300px !important;
    }
    
    .hero-buttons .flex {
        gap: 0.75rem !important;
    }
    
    .hero-buttons a {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
        min-height: 38px !important;
        font-weight: 500 !important;
    }
    
    /* Fix video cropping on mobile - show full video */
    #hero-video {
        object-fit: contain !important;
        object-position: center !important;
        width: 100% !important;
        height: 100% !important;
        min-width: auto !important;
        min-height: auto !important;
    }
}

/* Hero Video Styles */
#hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    object-fit: cover;
    object-position: center;
}

/* Video loading placeholder */
#hero-video:not([src]) {
    background: linear-gradient(135deg, #1B365D 0%, #0f2a47 100%);
}

/* Video text masking - to hide any text in the promotional video */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(27, 54, 93, 0.1) 0%,
        transparent 30%,
        transparent 70%,
        rgba(27, 54, 93, 0.15) 100%
    );
    z-index: 5;
    pointer-events: none;
}

/* Hero Buttons - Base Styles */
.hero-buttons {
    position: absolute;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 500px;
    z-index: 20;
}

.hero-button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.hero-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 2rem;
    transition: all 0.3s ease;
    min-height: 48px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #1B365D;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-btn-primary:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hero-btn-secondary {
    background: rgba(27, 54, 93, 0.9);
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-btn-secondary:hover {
    background: #1B365D;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 54, 93, 0.4);
}

/* Backdrop blur support for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        background-color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .bg-primary\/80 {
        background-color: rgba(27, 54, 93, 0.9) !important;
    }
    
    .bg-black\/30 {
        background-color: rgba(0, 0, 0, 0.4) !important;
    }
}

/* Video controls hover effects */
#video-toggle {
    transition: all 0.3s ease;
}

#video-toggle:hover {
    transform: scale(1.1);
}

/* Enhanced button styles for video overlay */
#hero .group {
    position: relative;
    overflow: hidden;
}

#hero .group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#hero .group:hover::before {
    left: 100%;
}

/* Desktop Hero Styles */
@media (min-width: 1025px) {
    .hero-button-container {
        flex-direction: row;
        gap: 1.5rem;
        justify-content: center;
    }
    
    .hero-buttons {
        bottom: 5rem;
        max-width: 600px;
    }
    
    .hero-btn {
        padding: 1.25rem 2.5rem;
        font-size: 1rem;
        min-height: 56px;
    }
}

/* Tablet Landscape (iPad Pro, etc) */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-button-container {
        flex-direction: row;
        gap: 1.25rem;
        justify-content: center;
    }
    
    .hero-buttons {
        bottom: 4rem;
        max-width: 520px;
    }
    
    .hero-btn {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
        min-height: 50px;
    }
    
}

/* Tablet Portrait (iPad, etc) */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-button-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons {
        bottom: 4rem;
        max-width: 400px;
    }
    
    .hero-btn {
        padding: 1.125rem 2.25rem;
        font-size: 1rem;
        min-height: 52px;
    }
    
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-button-container {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .hero-buttons {
        position: absolute;
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        max-width: 420px;
        width: calc(100% - 2rem);
    }
    
    .hero-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.75rem;
        min-height: 40px;
        border-radius: 1.25rem;
    }
    
    
    .hero-btn span {
        font-size: 0.75rem;
    }
    
    .hero-btn i {
        font-size: 0.6875rem;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .hero-button-container {
        flex-direction: column;
        gap: 0.875rem;
    }
    
    .hero-buttons {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        max-width: 320px;
        width: calc(100% - 2rem);
        padding: 0 1rem;
    }
    
    .hero-btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.8125rem;
        min-height: 46px;
        border-radius: 1.5rem;
    }
    
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .hero-buttons {
        bottom: 1.5rem;
        max-width: calc(100% - 1.5rem);
        padding: 0 0.75rem;
    }
    
    .hero-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.75rem;
        min-height: 42px;
        border-radius: 1.25rem;
    }
    
    .hero-btn i {
        font-size: 0.6875rem;
        margin-right: 0.375rem;
    }
    
    .hero-button-container {
        gap: 0.75rem;
    }
}


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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
}

/* Selection Color */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Unit Cards Styles */
.unit-card {
    position: relative;
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition-slow);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.unit-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Unit Gallery Styles */
.unit-gallery {
    position: relative;
    overflow: hidden;
    background: var(--gray-light);
}

.gallery-slide {
    transition: opacity 0.6s ease-in-out;
}

.gallery-slide.active {
    opacity: 1 !important;
}

.gallery-dot {
    cursor: pointer;
    transition: var(--transition);
}

.gallery-dot.active {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.2);
}

.view-btn {
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.view-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    transform: scale(1.05);
}

.view-btn:not(.active) {
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-medium);
}

.view-btn:hover {
    transform: scale(1.1);
    backdrop-filter: blur(15px);
}

/* Unit Gallery Modal */
.unit-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.unit-gallery-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.unit-gallery-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* Unit Gallery Image States */
.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1;
}

.gallery-image.active {
    opacity: 1;
    position: relative;
    z-index: 2;
}

.gallery-image:first-child.active {
    position: relative;
}

.gallery-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.gallery-nav button {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.gallery-nav button.active {
    background: white;
    transform: scale(1.3);
}

/* Enhanced Pricing Box */
.pricing-box {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid transparent;
    transition: var(--transition-slow);
}

.unit-card:hover .pricing-box {
    background: linear-gradient(135deg, #ebe4ff 0%, #ddd6fe 100%);
    border-color: var(--primary-color);
    transform: scale(1.02);
}

/* Feature List Enhancements */
.feature-item {
    padding: 0.5rem 0;
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateX(5px);
}

.feature-item i {
    transition: var(--transition);
}

.feature-item:hover i {
    transform: scale(1.2);
    color: var(--secondary-color);
}

/* Action Buttons Enhanced */
.action-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.action-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-slow);
}

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

.action-btn-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transition: var(--transition-slow);
    border: 2px solid transparent;
}

.action-btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    .unit-card {
        margin-bottom: 2rem;
    }
    
    .unit-gallery {
        height: 300px !important;
        min-height: 300px;
    }
    
    .view-btn {
        font-size: 10px;
        padding: 6px 12px;
    }
}

/* Clean Mobile Unit Cards Design */
@media (max-width: 768px) {
    /* Unit Cards Mobile Layout */
    .unit-card {
        margin-bottom: 2rem;
        border-radius: 1.5rem;
        overflow: hidden;
    }
    
    /* Force single column layout on mobile */
    .unit-card .grid.lg\\:grid-cols-2 {
        display: block !important;
    }
    
    /* Gallery Section Mobile */
    .unit-gallery {
        height: 280px !important;
        min-height: 280px;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* Clean Toggle Buttons - Outside Image Area */
    .view-toggles {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        z-index: 10;
        gap: 0.5rem;
        display: flex;
        background: transparent;
        padding: 1rem 1.5rem 0 1.5rem;
        border-radius: 0;
        backdrop-filter: none;
        justify-content: center;
    }
    
    .view-toggle {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
        font-weight: 600;
        background: #f8fafc;
        color: #1B365D;
        border: 2px solid #e2e8f0;
        border-radius: 2rem;
        min-height: 40px;
        min-width: 100px;
        transition: all 0.3s ease;
        text-align: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .view-toggle.active {
        background: #1B365D;
        color: white;
        border-color: #1B365D;
        box-shadow: 0 4px 12px rgba(27, 54, 93, 0.3);
        transform: translateY(-1px);
    }
    
    .view-toggle:hover:not(.active) {
        background: #f1f5f9;
        border-color: #cbd5e1;
        transform: translateY(-1px);
    }
    
    /* Zoom Button - Top Right */
    .unit-gallery .absolute.top-4.left-4 {
        top: 1rem;
        right: 1rem;
        left: auto;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Content Section Mobile */
    .unit-card .p-8.lg\\:p-10 {
        padding: 1.5rem !important;
    }
    
    /* Unit Title Mobile */
    .unit-card h3 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem;
    }
    
    .unit-card .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .unit-card .flex.items-center.justify-between span {
        align-self: flex-end;
    }
    
    /* Pricing Box Mobile */
    .pricing-box {
        margin-bottom: 1.5rem;
        padding: 1.25rem !important;
    }
    
    .pricing-box .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .pricing-box .grid-cols-2 {
        gap: 0.75rem;
    }
    
    .pricing-box .grid-cols-2 > div {
        padding: 0.75rem !important;
        font-size: 0.8125rem;
    }
    
    /* Features List Mobile */
    .unit-card .space-y-3 {
        margin-bottom: 1.25rem;
    }
    
    .unit-card .space-y-3 .flex {
        font-size: 0.875rem;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .unit-card .space-y-3 i {
        margin-top: 0.125rem;
        flex-shrink: 0;
    }
    
    /* Action Buttons Mobile */
    .unit-card .flex.flex-col.sm\\:flex-row:last-child {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .unit-card .flex.flex-col.sm\\:flex-row:last-child a,
    .unit-card .flex.flex-col.sm\\:flex-row:last-child button {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem;
        text-align: center;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet (iPad) Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Unit Cards Tablet Layout */
    .unit-card {
        margin-bottom: 3rem;
    }
    
    /* Gallery Section Tablet - Better Image Handling */
    .unit-gallery {
        height: 350px;
        max-height: 350px;
    }
    
    .unit-gallery .gallery-image {
        object-fit: cover;
        object-position: center;
    }
    
    /* Content padding tablet */
    .unit-card .p-8.lg\\:p-10 {
        padding: 2rem !important;
    }
    
    /* Desktop toggle buttons for tablet */
    .view-toggles-desktop {
        display: flex !important;
    }
    
    .view-toggles-desktop .view-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        min-height: 36px;
        min-width: 90px;
    }
    
    /* Hide mobile toggles on tablet */
    .view-toggles {
        display: none !important;
    }
    
    /* Pricing adjustments tablet */
    .pricing-box .text-4xl {
        font-size: 2rem !important;
    }
    
    /* Features text tablet */
    .unit-card .space-y-3 .flex {
        font-size: 0.9375rem;
    }
}

/* Portrait and Landscape Orientations */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    /* iPad Portrait */
    .unit-gallery {
        height: 300px;
    }
    
    .unit-card .grid.lg\\:grid-cols-2 {
        display: block !important;
    }
    
    /* Use mobile toggles in portrait */
    .view-toggles-desktop {
        display: none !important;
    }
    
    .view-toggles {
        display: flex !important;
        padding: 0.75rem 1.5rem 0 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    /* iPad Landscape */
    .unit-gallery {
        height: 350px;
    }
    
    .unit-card .grid.lg\\:grid-cols-2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* Auto-rotation Gallery Animation */
.gallery-image.auto-rotating {
    animation: autoRotateGallery 8s infinite;
}

@keyframes autoRotateGallery {
    0%, 45% {
        opacity: 1;
    }
    50%, 95% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@media (max-width: 640px) {
    /* Extra small mobile adjustments */
    .unit-card {
        border-radius: 16px;
        margin: 0 -0.5rem 2rem -0.5rem;
    }
    
    .unit-gallery {
        height: 260px !important;
        min-height: 260px;
    }
    
    /* Smaller pricing on very small screens */
    .pricing-box .text-4xl {
        font-size: 1.5rem !important;
    }
    
    /* Compact content */
    .unit-card .p-8.lg\\:p-10 {
        padding: 1.25rem !important;
    }
    
    /* Smaller toggle buttons */
    .view-toggle {
        padding: 0.5rem 0.875rem;
        font-size: 0.6875rem;
        min-width: 75px;
        min-height: 34px;
    }
    
    /* Unit section padding */
    #units {
        padding: 3rem 0 !important;
    }
    
    /* Section title mobile */
    #units h2 {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    #units > .container > .text-center p {
        font-size: 1rem !important;
        padding: 0 1rem;
    }
}

/* Loading Animation for Images */
.gallery-slide img {
    transition: opacity 0.3s ease-in-out;
}

.gallery-slide img[data-loading="true"] {
    opacity: 0.5;
}

/* Enhanced Shadows */
.shadow-3xl {
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
    }
    
    nav, footer, #lightbox, .unit-gallery-modal {
        display: none !important;
    }
    
    .unit-card {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
}

/* Amenities Gallery Styles */
.amenities-gallery {
    position: relative;
    background: linear-gradient(45deg, #f8fafc, #e5e7eb);
}

.amenities-gallery-image {
    transition: opacity 1s ease-in-out;
    object-position: center;
}

.amenities-gallery-dot {
    cursor: pointer;
    border: 2px solid white;
}

.amenities-gallery-dot.active {
    background-color: white !important;
    transform: scale(1.2);
}

.amenities-gallery-dot:hover {
    background-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.1);
}

.amenities-gallery-label {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.amenities-item {
    transition: all 0.3s ease;
}

.amenities-item:hover {
    transform: translateY(-2px);
    border-left-color: #1B365D !important;
    background-color: rgba(27, 54, 93, 0.05) !important;
}

/* Responsive Amenities Layout */
@media (max-width: 1023px) {
    /* Tablet Layout - Stack vertically */
    .amenities-gallery {
        margin-bottom: 3rem;
    }
    
    .amenities-item {
        padding: 1rem 1.25rem !important;
    }
    
    .amenities-item h3 {
        font-size: 1rem !important;
    }
    
    .amenities-item p {
        font-size: 0.875rem !important;
    }
}

@media (max-width: 767px) {
    /* Mobile Layout - Compact design */
    .amenities-gallery {
        height: 300px !important;
        margin-bottom: 2rem;
    }
    
    .amenities-item {
        padding: 0.875rem 1rem !important;
        margin-bottom: 0.75rem;
    }
    
    .amenities-item .bg-blue-50 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .amenities-item .fas {
        font-size: 1rem !important;
    }
    
    .amenities-item h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .amenities-item p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
    
    .amenities-gallery-label {
        padding: 0.5rem 0.875rem !important;
        font-size: 0.8rem !important;
    }
    
    .amenities-gallery-dot {
        width: 0.625rem !important;
        height: 0.625rem !important;
    }
}

@media (max-width: 480px) {
    /* Small Mobile - Even more compact */
    .amenities-gallery {
        height: 250px !important;
    }
    
    .amenities-item {
        padding: 0.75rem !important;
    }
    
    .amenities-item .bg-blue-50 {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    
    .amenities-item h3 {
        font-size: 0.85rem !important;
    }
    
    .amenities-item p {
        font-size: 0.75rem !important;
    }
}

/* Unit Cards Mobile Centering - Simple Direct Approach */
@media (max-width: 767px) {
    /* Target the unit card headers directly */
    .unit-card .mb-6:first-child .flex.items-center.justify-between {
        display: block !important;
        text-align: center !important;
    }
    
    /* Center the unit title */
    .unit-card .mb-6:first-child h3 {
        text-align: center !important;
        margin-bottom: 0.75rem !important;
        display: block !important;
        width: 100% !important;
    }
    
    /* Center and display badge below title */
    .unit-card .mb-6:first-child span {
        display: block !important;
        text-align: center !important;
        margin: 0 auto !important;
        width: fit-content !important;
    }
    
    /* Center the description */
    .unit-card .mb-6:first-child p {
        text-align: center !important;
        margin-top: 1rem !important;
    }
}

@media (max-width: 480px) {
    /* Small mobile adjustments */
    .unit-card .mb-6:first-child h3 {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .unit-card .mb-6:first-child span {
        font-size: 0.8rem !important;
        padding: 0.375rem 0.75rem !important;
    }
}

/* Broker Section Mobile Responsiveness */
@media (max-width: 767px) {
    /* Center broker content on mobile */
    #broker .text-center {
        text-align: center !important;
    }
    
    #broker h2 {
        text-align: center !important;
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }
    
    #broker h3 {
        text-align: center !important;
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    #broker p {
        text-align: center !important;
        font-size: 1rem !important;
    }
    
    /* ========================================
     * MOBILE RESPONSIVE FIXES FOR MAIN SECTIONS
     * ======================================== */
    
    /* Overview Section Mobile Optimization */
    #overview {
        padding: 3rem 0 !important;
    }
    
    #overview .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }
    
    #overview h2 {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    
    #overview .space-y-4 p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
    }
    
    #overview .grid.grid-cols-2 {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
        margin-top: 2rem !important;
        max-width: 320px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    #overview .grid.grid-cols-2 > div {
        text-align: center !important;
    }
    
    #overview .text-4xl {
        font-size: 1.875rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #overview .text-gray-600 {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
    
    /* Overview floating card mobile fix */
    #overview .absolute.-bottom-6.-left-6 {
        position: static !important;
        margin-top: 1.5rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 280px !important;
    }
    
    /* Location Section Mobile Optimization */
    #location {
        padding: 3rem 0 !important;
    }
    
    #location .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    #location h2 {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    
    #location p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    
    #location .h-96 {
        height: 300px !important;
    }
    
    #location ul {
        margin-bottom: 2rem;
    }
    
    #location .bg-primary {
        margin-top: 1.5rem !important;
        padding: 0.875rem 2rem !important;
        font-size: 0.875rem !important;
        display: block !important;
        text-align: center !important;
        max-width: 240px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Contact Section Mobile Optimization */
    #contact {
        padding: 3rem 0 !important;
    }
    
    #contact .text-center {
        margin-bottom: 2.5rem !important;
    }
    
    #contact h2 {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    #contact .text-xl {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    #contact .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Contact form mobile styling */
    #contact .bg-white.rounded-2xl.shadow-xl.p-8 {
        padding: 1.5rem !important;
        border-radius: 1rem !important;
        margin-bottom: 1.5rem;
    }
    
    #contact h3 {
        font-size: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    
    #contact .space-y-6 {
        gap: 1.25rem !important;
    }
    
    #contact input, 
    #contact select, 
    #contact textarea {
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    #contact button[type="submit"] {
        padding: 1rem !important;
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* Contact methods mobile styling */
    #contact .space-y-6 a {
        padding: 1rem !important;
        border-radius: 0.75rem !important;
        display: flex !important;
        align-items: center !important;
    }
    
    #contact .space-y-6 a .p-3 {
        padding: 0.75rem !important;
        width: 3rem !important;
        height: 3rem !important;
        flex-shrink: 0 !important;
    }
    
    #contact .space-y-6 a .text-xl {
        font-size: 1.25rem !important;
    }
    
    #contact .space-y-6 a .font-semibold {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    #contact .space-y-6 a .text-gray-600 {
        font-size: 0.875rem !important;
    }
    
    /* Contact info card spacing */
    #contact [data-aos="fade-left"] > div {
        margin-bottom: 1.5rem !important;
    }
    
    /* Ensure contact methods are properly stacked */
    #contact .space-y-6 {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
}
    
    /* Center broker affiliations on mobile */
    #broker .mb-6 h4 {
        text-align: center !important;
        font-size: 1.125rem !important;
    }
    
    #broker .flex.flex-wrap {
        justify-content: center !important;
    }
    
    #broker .bg-white\/20 {
        font-size: 0.875rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    /* Center contact methods on mobile */
    #broker .space-y-3 {
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #broker .flex.items-center.space-x-3 {
        justify-content: center !important;
        width: 100% !important;
    }
    
    /* Center button on mobile */
    #broker .mt-8 {
        text-align: center !important;
        margin-top: 2rem !important;
    }
    
    /* Broker image adjustments */
    #broker img {
        max-width: 80% !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    #broker .absolute.-bottom-6.-right-6 {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 1rem !important;
        width: fit-content !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }


@media (max-width: 480px) {
    #broker h2 {
        font-size: 1.75rem !important;
    }
    
    #broker h3 {
        font-size: 1.25rem !important;
    }
    
    #broker p {
        font-size: 0.9rem !important;
    }
    
    #broker .bg-white\/20 {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}