/* ============================================================
   Kingsgate Houses - Design System
   ============================================================ */

:root {
    --color-primary: #78b9ba;
    --color-primary-dark: #5a9e9f;
    --color-primary-light: #a5d4d5;
    --color-dark: #050505;
    --color-white: #FFFFFF;
    --color-light-accent: #f9f9f7;
    --color-dark-accent: #000000;
    --color-text: #585858;
    --color-link-hover: #7c782f;
    --color-bg-page: #f7f8fa;
    --transition: 0.3s ease;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.15);
    --radius: 12px;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Work Sans', sans-serif;
    color: var(--color-dark);
}
body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* ---- Navigation ---- */
.nav-link {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s ease;
    border-radius: 0.375rem;
    text-decoration: none;
}
.nav-link:hover { color: var(--color-primary); }
.nav-link-active { color: var(--color-primary) !important; }

.mobile-nav-link {
    display: block;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}
.mobile-nav-link:hover {
    color: var(--color-primary);
    background: var(--color-light-accent);
}

/* Transparent header */
.header-transparent { background: transparent; }
.header-transparent .nav-link,
.header-transparent #mobile-menu-btn { color: white; }
.header-transparent .nav-link:hover { color: var(--color-primary); }
.header-transparent .nav-link-active { color: var(--color-primary-light) !important; }

.header-scrolled {
    background: white !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
}
.header-scrolled .nav-link,
.header-scrolled #mobile-menu-btn { color: var(--color-text) !important; }
.header-scrolled .nav-link:hover,
.header-scrolled .nav-link-active { color: var(--color-primary) !important; }

/* ---- Hero ---- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.55) 100%);
}
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    padding: 0 1.5rem;
}
.hero-mini {
    min-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1.2;
}
.btn-primary {
    background: var(--color-primary);
    color: var(--color-dark);
}
.btn-primary:hover { background: var(--color-primary-dark); color: white; }
.btn-outline {
    border: 2px solid white;
    color: white;
    background: transparent;
}
.btn-outline:hover { background: white; color: var(--color-dark); }
.btn-dark {
    background: var(--color-dark);
    color: white;
}
.btn-dark:hover { background: var(--color-primary); color: var(--color-dark); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

/* ---- Property Cards ---- */
.property-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
}
.property-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}
.property-card .card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.property-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.property-card:hover .card-image img { transform: scale(1.05); }
.property-card .card-image .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition);
}
.property-card:hover .card-image .card-overlay { opacity: 1; }
.property-card .card-location {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text);
}

/* ---- WhatsApp Float ---- */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all var(--transition);
    animation: whatsapp-pulse 2s infinite;
    text-decoration: none;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: white;
}
.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background: var(--color-dark);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.whatsapp-float:hover .whatsapp-tooltip { opacity: 1; }
@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6); }
}

/* ---- Section Styles ---- */
.section-heading {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: var(--color-dark);
    margin-bottom: 1rem;
}
@media (min-width: 768px) { .section-heading { font-size: 2.5rem; } }
.section-subtitle {
    color: var(--color-text);
    font-size: 1.125rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Amenities ---- */
.amenity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-light-accent);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

/* ---- Gallery Masonry ---- */
.gallery-grid { columns: 1; column-gap: 16px; }
@media (min-width: 640px) { .gallery-grid { columns: 2; } }
@media (min-width: 1024px) { .gallery-grid { columns: 3; } }
.gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(120, 185, 186, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ---- Testimonials ---- */
.testimonial-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow-card);
    text-align: center;
}
.testimonial-quote {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .testimonial-quote { font-size: 1.25rem; } }
.testimonial-author {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    color: var(--color-dark);
}
.testimonial-location { font-size: 0.875rem; color: var(--color-text); margin-top: 0.25rem; }
.testimonial-stars { color: #f59e0b; font-size: 1.125rem; margin-bottom: 1rem; }

/* Swiper overrides */
.swiper-pagination-bullet-active { background: var(--color-primary) !important; }
.swiper-button-next, .swiper-button-prev { color: var(--color-primary) !important; }

/* ---- Forms ---- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: var(--color-text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}
.form-input::placeholder { color: #9ca3af; }
.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(120, 185, 186, 0.2);
}
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--color-dark); margin-bottom: 0.375rem; }
.form-error { color: #ef4444; font-size: 0.75rem; margin-top: 0.25rem; }

/* ---- Flash Messages ---- */
.flash-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}
.flash-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ---- Scroll indicator ---- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---- Currency Widget ---- */
.currency-widget {
    background: var(--color-light-accent);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #f3f4f6;
}

/* ---- Auto Currency Banner ---- */
.currency-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-dark);
    padding: 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 51;
}

/* ---- Hide scrollbar utility ---- */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .hero { min-height: 85vh; }
    .hero .btn-lg { width: 100%; max-width: 280px; justify-content: center; }
    .whatsapp-float { bottom: 80px; }
    /* White logo on transparent header (mobile homepage) */
    .header-transparent #header-logo { filter: brightness(0) invert(1); }
    .header-scrolled #header-logo { filter: none; }
}

/* ---- Line clamp ---- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Misc ---- */
::selection { background: var(--color-primary); color: white; }
html { scroll-behavior: smooth; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media print {
    .whatsapp-float, #back-to-top, #site-header, footer { display: none !important; }
    main { padding-top: 0 !important; }
}
