/* ==========================================================================
   KLA Construction — Mobile-First Responsive Overrides
   Loaded after main.css. Organized by component, mobile-first breakpoints.
   Breakpoints: base (320+), 480, 576, 768, 992
   ========================================================================== */

/* ==========================================================================
   1. TOUCH TARGETS & INPUT ZOOM PREVENTION
   ========================================================================== */

/* Prevent iOS zoom on input focus (requires 16px minimum) */
.kla-filters__field select,
.kla-filters__field input,
.kla-calculator__input-wrap input,
.kla-footer__newsletter-form input {
    font-size: 16px;
}

/* Minimum 44px tap targets */
.kla-btn {
    min-height: 44px;
}

.kla-nav > li > a {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.kla-pagination .page-numbers {
    min-width: 44px;
    min-height: 44px;
}

.kla-header__socials a,
.kla-footer__socials a {
    min-width: 44px;
    min-height: 44px;
}

/* ==========================================================================
   2. TOUCH HOVER GUARD
   ========================================================================== */

@media (hover: none) {
    /* Disable translateY hover lifts on touch */
    .kla-card:hover {
        transform: none;
        box-shadow: var(--kla-shadow-sm);
        border-color: var(--kla-border-light);
    }

    .kla-card:hover .kla-card__img::after {
        opacity: 0;
    }

    .kla-card:hover .kla-card__img img {
        transform: none;
    }

    .kla-card:hover .kla-card__badge {
        background: rgba(255,255,255,.95);
        color: var(--kla-text);
    }

    .kla-btn--primary:hover,
    .kla-btn--gold:hover,
    .kla-btn--whatsapp:hover {
        transform: none;
    }

    .kla-btn:hover::after {
        opacity: 0;
    }

    .kla-testimonial:hover {
        box-shadow: var(--kla-shadow-sm);
        border-color: var(--kla-border-light);
    }

    .kla-whatsapp:hover {
        transform: none;
        box-shadow: 0 4px 16px rgba(37, 211, 102, .35);
        border-radius: var(--kla-radius);
    }

    .kla-whatsapp:hover .kla-whatsapp__tooltip {
        opacity: 0;
    }

    .kla-footer__socials a:hover {
        transform: none;
    }

    .kla-footer__newsletter-form button:hover {
        transform: none;
    }
}

/* ==========================================================================
   3. FLUID SPACING & TYPOGRAPHY
   ========================================================================== */

.kla-container {
    padding: 0 clamp(16px, 4vw, 24px);
}

.kla-section {
    padding: clamp(48px, 8vw, 100px) 0;
}

.kla-section-label {
    font-size: clamp(10px, 2.5vw, 12px);
}

.kla-section-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

/* ==========================================================================
   4. HEADER — Full-screen Nav Overlay
   ========================================================================== */

@media (max-width: 992px) {
    /* Hide top bar on small screens for space */
    .kla-header__top {
        font-size: 11px;
        padding: 6px 0;
    }
    .kla-header__email,
    .kla-header__separator {
        display: none;
    }

    .kla-header__nav-inner {
        min-height: 60px;
    }

    .kla-header__logo img,
    .kla-header__logo-img {
        max-height: 48px;
    }

    /* Full-screen overlay nav */
    .kla-nav {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(255,255,255,.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        z-index: 9999;
        padding: 24px;
        gap: 0;
        border-top: none;
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease, visibility .3s ease;
    }

    .kla-nav.active {
        opacity: 1;
        visibility: visible;
    }

    .kla-nav > li {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .3s ease, transform .3s ease;
    }

    .kla-nav.active > li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger link animations */
    .kla-nav.active > li:nth-child(1) { transition-delay: .05s; }
    .kla-nav.active > li:nth-child(2) { transition-delay: .1s; }
    .kla-nav.active > li:nth-child(3) { transition-delay: .15s; }
    .kla-nav.active > li:nth-child(4) { transition-delay: .2s; }
    .kla-nav.active > li:nth-child(5) { transition-delay: .25s; }
    .kla-nav.active > li:nth-child(6) { transition-delay: .3s; }
    .kla-nav.active > li:nth-child(7) { transition-delay: .35s; }

    .kla-nav > li > a {
        padding: 14px 8px;
        font-size: 18px;
        font-weight: 600;
        text-align: center;
        justify-content: center;
    }

    .kla-nav .sub-menu {
        position: static;
        text-align: center;
        padding: 0;
    }

    .kla-nav .sub-menu a {
        text-align: center;
        font-size: 15px;
        padding: 10px 8px;
    }

    /* Burger z-index above overlay */
    .kla-header__burger {
        position: relative;
        z-index: 10000;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .kla-header__top {
        display: none;
    }
}

/* ==========================================================================
   5. HERO
   ========================================================================== */

@media (max-width: 768px) {
    .kla-hero__content {
        padding: 32px 16px;
    }

    .kla-hero__label {
        font-size: 10px;
        letter-spacing: 3px;
        margin-bottom: 16px;
    }

    .kla-hero__subtitle {
        margin-bottom: 28px;
    }

    /* 2x2 stats grid */
    .kla-hero__stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-top: 36px;
        padding-top: 28px;
    }

    .kla-hero__stat-divider {
        display: none;
    }

    .kla-hero__stat strong {
        font-size: 1.6rem;
    }

    .kla-hero__stat span {
        font-size: 11px;
    }

    .kla-hero__scroll {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Stack hero buttons vertically */
    .kla-hero__actions {
        flex-direction: column;
        align-items: center;
    }

    .kla-hero__actions .kla-btn {
        width: 100%;
        max-width: 300px;
    }

    /* Hide decorative circles */
    .kla-hero__deco {
        display: none;
    }
}

/* ==========================================================================
   6. PROPERTY CARDS
   ========================================================================== */

@media (max-width: 768px) {
    .kla-card__img {
        aspect-ratio: 16/10;
    }

    .kla-card__body {
        padding: 18px;
    }

    .kla-card__title {
        font-size: 18px;
    }

    .kla-card__price {
        font-size: 15px;
    }
}

/* ==========================================================================
   7. FILTERS
   ========================================================================== */

@media (max-width: 768px) {
    .kla-filters {
        padding: 20px;
        margin-top: -28px;
        border-radius: 12px;
    }

    .kla-filters__row {
        gap: 12px;
    }

    .kla-filters__field--btn .kla-btn {
        width: 100%;
    }
}

/* ==========================================================================
   8. SINGLE PROPERTY
   ========================================================================== */

@media (max-width: 768px) {
    .kla-property-hero {
        padding: 16px 0;
    }

    .kla-property-layout {
        gap: 24px;
        padding: 12px 0 48px;
    }

    .kla-property-price-card {
        position: static;
        padding: 24px;
    }

    .kla-property__features {
        padding: 16px;
        gap: 12px;
    }

    .kla-property-gallery__thumb {
        flex: 0 0 90px;
    }
}

/* ==========================================================================
   9. TESTIMONIALS
   ========================================================================== */

@media (max-width: 768px) {
    .kla-testimonial {
        padding: 24px;
    }

    .kla-testimonial::before {
        font-size: 56px;
        top: 12px;
        right: 16px;
    }

    .kla-testimonial__text {
        font-size: 14px;
        line-height: 1.7;
    }

    .kla-testimonial__avatar {
        width: 40px;
        height: 40px;
    }

    .kla-testimonial__name {
        font-size: 15px;
    }

    .kla-testimonial__author {
        gap: 10px;
        padding-top: 16px;
    }
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */

@media (max-width: 768px) {
    .kla-footer__grid {
        text-align: center;
        gap: 32px;
    }

    .kla-footer__col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .kla-footer__col ul {
        align-items: center;
    }

    .kla-footer__contact li {
        justify-content: center;
    }

    .kla-footer__socials {
        justify-content: center;
    }

    .kla-footer__socials a {
        width: 44px;
        height: 44px;
    }

    .kla-footer__logo {
        display: flex;
        justify-content: center;
    }

    .kla-footer__desc {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .kla-footer__newsletter {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .kla-footer__newsletter-form {
        flex-direction: column;
    }

    .kla-footer__newsletter-form input,
    .kla-footer__newsletter-form button {
        width: 100%;
    }
}

/* ==========================================================================
   11. WHATSAPP FLOATING BUTTON
   ========================================================================== */

@media (max-width: 768px) {
    .kla-whatsapp {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 20px;
        border-radius: var(--kla-radius);
    }

    .kla-whatsapp svg {
        width: 22px;
        height: 22px;
    }

    /* Hide tooltip on mobile */
    .kla-whatsapp__tooltip {
        display: none;
    }
}

/* ==========================================================================
   12. ARCHIVE HERO
   ========================================================================== */

@media (max-width: 768px) {
    .kla-archive-hero {
        padding: 48px 0 40px;
    }
}

/* ==========================================================================
   13. BODY SCROLL LOCK (when nav overlay is open)
   ========================================================================== */

body.kla-nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ==========================================================================
   14. ABOUT PAGE
   ========================================================================== */

@media (max-width: 768px) {
    .kla-about-hero { padding: 60px 0 48px; }
    .kla-about-stats { padding: 40px 0; }
    .kla-about-cta { padding: 48px 0; }
    .kla-about-cta__actions { flex-direction: column; align-items: center; }
    .kla-about-cta__actions .kla-btn { width: 100%; max-width: 320px; }
}

/* ==========================================================================
   15. CONTACT PAGE
   ========================================================================== */

.kla-contact-form__field input,
.kla-contact-form__field select,
.kla-contact-form__field textarea {
    font-size: 16px;
}

@media (max-width: 768px) {
    .kla-contact-cards { margin-top: -28px; }
    .kla-contact-layout { gap: 36px; }
}

/* ==========================================================================
   16. BLOG
   ========================================================================== */

@media (max-width: 768px) {
    .kla-blog-featured { margin-bottom: 36px; padding-bottom: 36px; }
}

/* ==========================================================================
   17. REALISATION
   ========================================================================== */

@media (max-width: 768px) {
    .kla-realisation-layout { gap: 24px; padding: 12px 0 48px; }
}

/* ==========================================================================
   18. TOUCH HOVER GUARD — NEW PAGES
   ========================================================================== */

@media (hover: none) {
    .kla-about-value:hover { transform: none; box-shadow: var(--kla-shadow-sm); }
    .kla-contact-card:hover { transform: none; box-shadow: var(--kla-shadow); }
    .kla-blog-card:hover { transform: none; box-shadow: var(--kla-shadow-sm); }
    .kla-blog-featured:hover .kla-blog-featured__img img { transform: none; }
}

/* ==========================================================================
   19. 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;
    }

    .kla-reveal {
        opacity: 1;
        transform: none;
    }

    .kla-hero__video {
        display: none;
    }
}
