/* ...move all CSS from <style> block in city_crown.html here... */
/* enhance root with layout variables */
:root {
    /* Color Palette: Sober & Lucrative */
    --primary-dark: #0F172A;
    /* Deep Navy */
    --accent-gold: #C5A059;
    /* Muted Gold */
    --accent-light: #F8FAFC;
    /* Off White */
    --text-grey: #475569;
    /* Readable Grey */
    --white: #ffffff;
    --pure-white: #ffffff;
    --royal-gold: #D4AF37;
    --primary-navy: #0D1B2A;

    /* Layout variables */
    --nav-height: 72px;
    --section-vertical-desktop: 100px;
    --section-vertical-mobile: 36px;
    --container-padding-desktop: 24px;
    --container-padding-mobile: 16px;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-dark);
    background-color: var(--accent-light);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--nav-height);
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    transition: 0.3s !important;
}

.gold-text {
    color: var(--accent-gold);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--container-padding-desktop);
    padding-right: var(--container-padding-desktop);
}

/* Navigation */
nav {
    background: rgba(255, 255, 255, 0.98);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 50px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: 40px;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-gold);
}


.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--royal-gold);
    transition: 0.3s;
}

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

.nav-links .btn-contact {
    background-color: var(--primary-dark);
    color: var(--pure-white) !important;
    border-radius: 2px;
    padding: 10px 25px;
    font-weight: 600;
    text-transform: none;
    transition: background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    height: 40px;
}

.nav-links .btn-contact:hover {
    background-color: var(--accent-gold);
    color: var(--primary-dark) !important;
}

.btn-gold {
    background-color: var(--royal-gold);
    color: var(--pure-white) !important;
    padding: 14px 32px;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: 2px;
    display: inline-block;
    border: 2px solid var(--royal-gold);
    cursor: pointer;
}

.btn-gold:hover {
    background-color: transparent;
    color: var(--royal-gold) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-contact {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.3s, color 0.3s;
    z-index: 120;
    pointer-events: auto;
}

.btn-contact:hover {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding-top: 80px;
    overflow: hidden;
    background: none;
    /* Remove static background */
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
}

.carousel-img.active {
    opacity: 1;
    z-index: 2;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.6));
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 4;
    pointer-events: none;
    /* Allow clicks to pass through */
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--white);
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 30px;
    letter-spacing: 2px;
    animation: fadeInUp 1.2s ease-out;
}

/* Overview Section */
.overview {
    padding-top: var(--section-vertical-desktop);
    padding-bottom: var(--section-vertical-desktop);
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-gold);
}

.overview-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-grey);
}

/* At a Glance (Stats) */
.stats-section {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Amenities */
.amenities {
    padding-top: var(--section-vertical-desktop);
    padding-bottom: var(--section-vertical-desktop);
    background-color: var(--white);
}
.units-section{
    padding-top: var(--section-vertical-desktop);
    padding-bottom: var(--section-vertical-desktop);
    background-color: var(--white);
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.amenity-card {
    background: var(--accent-light);
    padding: 40px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid #e2e8f0;
}

.amenity-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--accent-gold);
}

.amenity-card i {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

/* Specs & Details */
.specs {
    padding-top: var(--section-vertical-desktop);
    padding-bottom: var(--section-vertical-desktop);
}

.specs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

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

.spec-list li {
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: start;
    gap: 15px;
    color: var(--text-grey);
}

.spec-list li i {
    color: var(--accent-gold);
    margin-top: 5px;
}

/* Location */
.location {
    padding-top: var(--section-vertical-desktop);
    padding-bottom: var(--section-vertical-desktop);
    background-color: var(--primary-dark);
    color: var(--white);
    text-align: center;
}

.location h2 {
    color: var(--white);
    margin-bottom: 50px;
}

.landmarks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent-gold);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
}

/* --- FOOTER & CONTACT --- */
footer {
    background-color: var(--primary-navy);
    color: #a0aec0;
    padding-top: 80px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    background: white;
    padding: 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 20px;
}

.footer h4 {
    color: var(--pure-white);
    margin-bottom: 25px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 12px;
}

.footer ul li a {
    color: #a0aec0;
}

.footer ul li a:hover {
    color: var(--royal-gold);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.footer-contact i {
    color: var(--royal-gold);
    margin-top: 5px;
}

.partner-logos {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.partner-logo {
    height: 40px;
    background: white;
    padding: 5px;
    border-radius: 4px;
    opacity: 0.9;
}

.footer-bottom {
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* Hamburger button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1201;
    margin-left: 10px;
}

.nav-toggle .bar {
    width: 26px;
    height: 3px;
    background: var(--primary-dark);
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Collapsible mobile nav */
.mobile-nav-links {
    display: none;
    flex-direction: column;
    background: #fff;
    position: fixed;
    top: 65px;
    left: 0;
    width: 100vw;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    padding: 18px 0 12px 0;
    gap: 0;
}

.mobile-nav-links a {
    color: var(--primary-dark);
    text-decoration: none;
    padding: 14px 24px;
    font-size: 1.1rem;
    border-bottom: 1px solid #f1f1f1;
    display: block;
    font-weight: 500;
}

.mobile-nav-links a.btn-contact {
    margin: 10px 24px 0 24px;
    border-radius: 2px;
    border: none;
    display: block;
    text-align: center;
    background: var(--primary-dark);
    color: var(--white) !important;
    font-weight: 600;
    padding: 12px 0;
    font-size: 1.05rem;
    transition: background 0.3s, color 0.3s;
}

.mobile-nav-links a.btn-contact:hover {
    background: var(--accent-gold);
    color: var(--primary-dark) !important;
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

/* Show/hide logic */
.mobile-nav-links.open {
    display: flex;
    animation: fadeInDown 0.25s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

    .overview-grid, .specs-container {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .carousel-nav {
        z-index: 100;
        font-size: 2rem;
        top: auto;
        bottom: 20px;
        transform: none;
        background: rgba(255, 255, 255, 0.35);
        width: 38px;
        height: 38px;
        padding: 0;
        pointer-events: auto;
    }

    .carousel-prev {
        left: 15px;
    }

    .carousel-next {
        right: 15px;
    }

    /* Add safe padding for all main containers */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Add padding for hero-content if needed */
    .hero-content {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Add padding for section titles and paragraphs */
    .section-title {
        padding-left: 2px;
        padding-right: 2px;
        font-size: 2rem;
    }

    .overview-text p,
    .amenities p,
    .spec-list,
    .location p {
        padding-left: 2px;
        padding-right: 2px;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .mobile-nav-links {
        display: none;
    }

    .mobile-nav-links.open {
        display: flex;
    }
}

/* very small devices */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.6rem;
        padding-left: 8px;
        padding-right: 8px;
    }
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Perspective Carousel */
.perspective-carousel {
    position: relative;
    background-color: #e2e8f0;
    height: 400px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perspective-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
}

.perspective-img.active {
    opacity: 1;
    z-index: 2;
}

.perspective-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(226, 232, 240, 0.3), rgba(100, 116, 139, 0.2));
    z-index: 3;
}

.perspective-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    z-index: 4;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px 0;
    border-radius: 4px;
}

/* Carousel Navigation Arrows */
.carousel-nav,
.perspective-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #0F172A;
    font-size: 2.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    /* Ensure nav is always above hero-content */
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    opacity: 0.7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.carousel-nav:hover,
.perspective-nav:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--accent-gold);
    opacity: 1;
}

.carousel-prev,
.perspective-prev {
    left: 20px;
}

.carousel-next,
.perspective-next {
    right: 20px;
}

/* Ensure nav buttons are not selectable */
.carousel-nav:focus,
.perspective-nav:focus {
    outline: none;
}

/* --- LOCATION --- */
.location-section {
    position: relative;
}

.map-frame {
    width: 100%;
    height: 450px;
    border: 0;
    filter: grayscale(20%);
}

/* Progress Bar for Carousels */
.carousel-progress-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-gold, #FFD700), var(--royal-gold, #E5C100));
    z-index: 100;
    border-radius: 2px;
    transition: width 0s;
    pointer-events: none;
    opacity: 1;
}

/* Units tweaks (desktop) */
.units-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Collapsed tabs: ensure no blank gap and smooth transition */
.unit-tabs {
    transition: max-height .22s ease, padding .18s ease, margin .18s ease;
    max-height: 1200px; /* expanded default */
}
.unit-tabs.collapsed {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    max-height: 48px !important; /* header height */
    border-radius: 6px !important;
}
.unit-tabs.collapsed ul {
    display: none !important;
}
.unit-tabs .tabs-header {
    display: none;
}
/* show header on small screens handled below */

@media (max-width: 900px) {
    /* Stack with tabs first on small screens */
    .units-grid {
        flex-direction: column;
    }

    .unit-tabs {
        width: 100%;
        margin-bottom: 12px;
        padding: 8px;
    }

    .unit-tabs .tabs-header {
        display: flex;
    }

    .unit-tabs ul {
        margin-top: 8px;
    }

    /* ensure collapsed max-height is enforced on mobile and no blank space */
    .unit-tabs.collapsed {
        max-height: 48px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    /* --- MOBILE: add horizontal padding so heading / intro don't touch the edge --- */
    .units-section .section-title,
    .units-section > p {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* container padding for small screens */
    .container {
        padding-left: var(--container-padding-mobile);
        padding-right: var(--container-padding-mobile);
    }

    /* reduced vertical spacing on mobile */
    .overview,
    .amenities,
    .specs,
    .location,
    .units-section {
        padding-top: var(--section-vertical-mobile);
        padding-bottom: var(--section-vertical-mobile);
    }

    /* Make the preview area more compact on mobile */
    .unit-preview {
        padding: 12px;
        border-radius: 6px;
    }
}

/* --- Styles moved from index.html <style> block --- */

/* footer responsive tweaks */
@media (max-width: 900px) {
    .footer-top {
        display: block !important;
        padding-bottom: 30px;
    }

    .footer-top>div {
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .footer-top>div {
        margin-bottom: 20px;
    }

    .footer-logo img {
        max-width: 90vw;
        height: auto !important;
    }
}

/* Loading spinner used in hero & perspective loaders */
.realestate-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #fff;
    border-top: 6px solid #C5A059;
    border-radius: 50%;
    animation: realestate-spin 1s linear infinite;
    margin: 0 auto;
    box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.12);
}

@keyframes realestate-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Units Section Styles (moved) */
.units-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.unit-preview {
    flex: 1 1 60%;
    background: linear-gradient(180deg, rgba(0,0,0,0.04), transparent);
    border-radius: 8px;
    padding: 18px;
    position: relative;
}

.unit-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(11,17,33,0.06);
    display: block;
}

.unit-details {
    margin-top: 14px;
    color: var(--text-dark, #0f172a);
}

.unit-details h3 {
    margin: 0 0 6px 0;
}

.unit-tabs {
    width: 320px;
    flex: 0 0 320px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 12px;
}

.unit-tabs ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.unit-tabs li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .18s, transform .08s;
    margin-bottom: 8px;
}

.unit-tabs li:hover {
    transform: translateY(-2px);
}

.unit-tabs li.active {
    background: linear-gradient(90deg, rgba(197,160,89,0.12), rgba(197,160,89,0.06));
    border: 1px solid rgba(197,160,89,0.15);
}

.unit-tabs .unit-meta {
    color: var(--text-grey, #6b7280);
    font-size: 0.95rem;
}

/* Collapsible tabs header for mobile (moved) */
.unit-tabs .tabs-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}
/* make header height predictable */
.unit-tabs .tabs-header { padding: 12px 10px; }

.unit-tabs .tabs-header .tabs-title {
    font-size: 1rem;
    color: var(--text-dark, #0f172a);
}

.unit-tabs .tabs-header .tabs-toggle {
    transition: transform .22s ease;
    font-size: 1.05rem;
    color: var(--text-grey, #6b7280);
}

/* collapsed state hides list on mobile and rotates icon */
.unit-tabs.collapsed {
    /* remove interior spacing so only header shows */
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    background: transparent;
    overflow: hidden;
    /* limit height to header (approx) to avoid blank gap */
    max-height: 56px;
}
.unit-tabs.collapsed ul { display: none; }
.unit-tabs.collapsed .tabs-toggle { transform: rotate(-90deg); }
/* when expanded allow the full content */
.unit-tabs { transition: max-height .22s ease; }
.unit-tabs:not(.collapsed) { max-height: 1200px; }

@media (max-width: 900px) {
    /* Stack with tabs first on small screens */
    .units-grid { flex-direction: column; }

    .unit-tabs {
        width: 100%;
        margin-bottom: 12px;
        /* show header on narrow screens */
        padding: 8px;
    }

    .unit-tabs .tabs-header {
        display: flex;
    }

    .unit-tabs ul {
        margin-top: 8px;
    }
    /* ensure collapsed max-height is enforced on mobile */
    .unit-tabs.collapsed { max-height: 56px; }
}

/* Desktop: limit unit preview width and image height so unit images don't stretch too large */
@media (min-width: 901px) {
    .units-grid {
        /* keep tabs and preview aligned left with controlled spacing */
        justify-content: flex-start;
    }

    .unit-preview {
        /* limit preview width on desktop */
        max-width: 820px; /* adjust as needed (720-900px) */
        flex: 1 1 60%;
        /* make letterbox areas look intentional when image aspect ratio differs */
        background: linear-gradient(180deg, rgba(248,250,252,0.6), rgba(248,250,252,0.4));
    }

    .unit-preview img {
        width: 100%;
        height: auto;            /* keep natural aspect ratio, do not force height */
        max-height: 560px;      /* limit visual size but do not crop */
        object-fit: contain;    /* ensure the whole image is visible (no cropping) */
        display: block;
        margin: 0 auto;
    }
}

/* End moved styles */