/* ====================================================================
   CASA-SIP — PERFECT MOBILE CSS v3.0
   Full coverage: 320px → 768px | Every section, every detail
   ==================================================================== */

/* ─────────────────────────────────────────────────────────────────────
   0. BASE & ROOT
   ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body { overflow-x: hidden !important; }

/* ─────────────────────────────────────────────────────────────────────
   1. PRELOADER
   ───────────────────────────────────────────────────────────────────── */
#preloader { -webkit-transform: translateZ(0); transform: translateZ(0); }
#preloader.hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────
   2. HEADER — fixed, always works
   ───────────────────────────────────────────────────────────────────── */
.site-header {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: rgba(10,15,28,0.92) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-transform: translate3d(0,0,0) !important;
    transform: translate3d(0,0,0) !important;
    padding: 14px 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   3. HERO SECTION
   ───────────────────────────────────────────────────────────────────── */
.hero-section {
    position: relative !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #0f172a !important;
    background-attachment: scroll !important;
}
.hero-image-container {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    overflow: hidden !important;
}
.hero-image {
    width: 100% !important; height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    filter: brightness(0.5) !important;
    animation: none !important;
    transform: none !important;
}
.hero-gradient-overlay {
    z-index: 2 !important;
    background: linear-gradient(180deg,
        rgba(10,15,28,0.6) 0%,
        rgba(10,15,28,0.25) 50%,
        rgba(10,15,28,0.65) 100%) !important;
}
.hero-content {
    position: relative !important;
    z-index: 10 !important;
    width: 100% !important;
    max-width: 1200px !important;
    padding: 100px 20px 50px !important;
    text-align: center !important;
}
.hero-title, .title-line {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5) !important;
}
.title-highlight {
    background: linear-gradient(135deg, #dc2626, #f59e0b) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
.hero-subtitle { color: rgba(255,255,255,0.88) !important; }
.main-navigation { z-index: 9998 !important; }

/* ─────────────────────────────────────────────────────────────────────
   4. iOS SAFARI SPECIAL
   ───────────────────────────────────────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
    .hero-section { min-height: -webkit-fill-available !important; }
    input, textarea, select { font-size: 16px !important; }
}

/* =====================================================================
   TABLET (max-width: 992px)
   ===================================================================== */
@media (max-width: 992px) {

    /* Mobile menu drawer */
    .main-navigation {
        position: fixed !important;
        top: 0 !important; right: -100% !important;
        width: min(300px, 85vw) !important;
        height: 100vh !important; height: 100dvh !important;
        background: rgba(10,15,28,0.97) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        backdrop-filter: blur(20px) !important;
        padding: 90px 30px 30px !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        border-left: 1px solid rgba(245,158,11,0.15) !important;
    }
    .main-navigation.active { right: 0 !important; }
    .mobile-menu-toggle { display: flex !important; z-index: 10000 !important; }
    .language-switcher { display: none !important; }
    .language-switcher-mobile { display: flex !important; }

    /* TPS section */
    .tps-container { padding: 0 24px; }
    .tps-head { flex-direction: column; align-items: flex-start; gap: 24px; margin-bottom: 40px; }
    .tps-soon-row { grid-template-columns: 1fr !important; }
    .tps-proj-half { width: 100% !important; }

    /* Contact */
    .contact-container { grid-template-columns: 1fr; }
}

/* =====================================================================
   MOBILE (max-width: 768px)
   ===================================================================== */
@media (max-width: 768px) {

    :root { --section-padding: 60px 0; }

    .section { padding: 60px 0 !important; }
    .container { padding: 0 18px !important; }
    .section-header { margin-bottom: 36px !important; }
    .section-title { font-size: clamp(1.6rem, 6vw, 2rem) !important; }
    .section-subtitle { font-size: 0.93rem !important; line-height: 1.65 !important; }

    /* ── HERO ── */
    .hero-content { padding: 90px 18px 44px !important; }
    .hero-title  { font-size: clamp(1.8rem, 7.5vw, 2.8rem) !important; line-height: 1.15 !important; }
    .title-line  { display: block !important; }
    .title-highlight { display: block !important; }
    .hero-subtitle { font-size: 0.9rem !important; line-height: 1.65 !important; margin-bottom: 22px !important; }
    .hero-actions { flex-direction: column !important; gap: 12px !important; margin-bottom: 24px !important; }
    .hero-actions .btn { width: 100% !important; justify-content: center !important; padding: 15px 20px !important; }
    .hero-features-list { flex-wrap: wrap !important; justify-content: center !important; gap: 8px !important; }
    .feature-badge { font-size: 0.8rem !important; padding: 7px 13px !important; }

    /* ── TPS — TOP 3 PROIECTE ── */
    .tps-wrap { padding: 60px 0 70px; }
    .tps-container { padding: 0 16px; }
    .tps-head { flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 36px; }
    .tps-h2-num { font-size: clamp(3rem, 14vw, 5.5rem) !important; }
    .tps-h2-text { font-size: clamp(1.6rem, 7vw, 3rem) !important; }
    .tps-head-right p { font-size: 0.9rem; }
    .tps-head-btn { padding: 10px 20px; font-size: 0.85rem; }

    /* TPS project mosaic → stacked */
    .tps-proj {
        flex-direction: column !important;
        display: flex !important;
        gap: 0 !important;
    }
    .tps-mosaic {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 3px !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }
    .tps-mos-main {
        height: 240px !important;
        border-radius: 0 !important;
    }
    .tps-mos-main img {
        width: 100% !important; height: 100% !important;
        object-fit: cover !important;
    }
    .tps-mos-side {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 3px !important;
    }
    .tps-mos-sm {
        height: 100px !important;
        border-radius: 0 !important;
    }
    .tps-mos-sm img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

    .tps-info {
        padding: 22px 0 0 !important;
        border: none !important;
    }
    .tps-info h3 { font-size: 1.3rem !important; margin-bottom: 10px !important; }
    .tps-info p { font-size: 0.9rem !important; line-height: 1.6 !important; }
    .tps-stats {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px 0 !important;
    }
    .tps-stat { font-size: 0.85rem !important; flex: 1 1 45% !important; }
    .tps-stat strong { font-size: 1.2rem !important; }
    .tps-features { flex-wrap: wrap !important; gap: 8px !important; font-size: 0.82rem !important; }
    .tps-cta { width: 100% !important; justify-content: center !important; padding: 13px 20px !important; }
    .tps-proj-num {
        font-size: clamp(5rem, 20vw, 9rem) !important;
        left: -6px !important; top: -20px !important;
    }
    .tps-soon-row { display: flex !important; flex-direction: column !important; gap: 40px !important; }
    .tps-proj-half { width: 100% !important; max-width: 100% !important; }

    /* ── SERVICES ── */
    .services-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .service-card { padding: 26px 20px !important; }
    .icon-wrapper { width: 56px !important; height: 56px !important; }
    .icon-wrapper svg { width: 28px !important; height: 28px !important; }
    .service-card h3 { font-size: 1.1rem !important; }
    .service-card p { font-size: 0.88rem !important; }
    .service-features li span { font-size: 0.85rem !important; }

    /* ── PROCESS ── */
    .process-timeline { grid-template-columns: 1fr !important; gap: 20px !important; }
    .timeline-item { padding: 0 !important; }
    .timeline-content {
        padding: 22px 18px !important;
        border-radius: 14px !important;
    }
    .timeline-icon {
        width: 52px !important; height: 52px !important;
        margin-bottom: 14px !important;
    }
    .timeline-icon svg { width: 22px !important; height: 22px !important; }
    .timeline-content h3 { font-size: 1.05rem !important; margin-bottom: 8px !important; }
    .timeline-content p { font-size: 0.88rem !important; }

    /* ── CEO LEGEND ── */
    .ceo-legend-section { padding: 70px 0 !important; }
    .ceo-legend-inner {
        flex-direction: column !important;
        gap: 44px !important;
        text-align: center !important;
    }
    .ceo-legend-photo-side { width: 100% !important; }
    .ceo-legend-photo-wrap {
        width: 260px !important; height: 340px !important;
        margin: 0 auto !important;
    }
    .ceo-legend-photo-ring--outer { width: 290px !important; height: 290px !important; top: 25px !important; left: -15px !important; }
    .ceo-legend-photo-ring--inner { width: 230px !important; height: 230px !important; top: 55px !important; left: 15px !important; }
    .ceo-legend-eyebrow { justify-content: center !important; }
    .ceo-legend-name { font-size: clamp(2rem, 9vw, 3.5rem) !important; }
    .ceo-legend-role { font-size: 1rem !important; }
    .ceo-legend-divider { justify-content: center !important; }
    .ceo-legend-facts {
        padding: 20px 16px !important;
        gap: 0 !important;
    }
    .clf-num { font-size: 28px !important; }
    .clf-label { font-size: 10px !important; }
    .ceo-legend-cta {
        align-self: center !important;
        width: 100% !important;
        max-width: 280px !important;
        justify-content: center !important;
    }

    /* ── CALCULATOR ── */
    .calculator-wrapper { grid-template-columns: 1fr !important; gap: 24px !important; }
    .calculator-form,
    .calculator-result { padding: 24px 16px !important; border-radius: 16px !important; }
    .calculator-form .form-group { margin-bottom: 18px !important; }
    .form-input, .form-select {
        padding: 13px 14px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
    .form-textarea { font-size: 16px !important; padding: 13px 14px !important; }
    .checkbox-group { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .checkbox-label { font-size: 0.88rem !important; }
    .currency-toggle { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
    .currency-btn { padding: 10px 8px !important; font-size: 0.85rem !important; text-align: center !important; }
    .result-card { padding: 24px 16px !important; }
    .price-amount { font-size: 2.2rem !important; }
    .result-breakdown { margin: 16px 0 !important; }
    .breakdown-item { font-size: 0.88rem !important; padding: 8px 0 !important; }
    .result-features { flex-wrap: wrap !important; gap: 8px !important; }
    .feature-tag { font-size: 0.78rem !important; padding: 6px 10px !important; }
    .btn-block { padding: 14px 20px !important; font-size: 0.92rem !important; }
    .result-note { font-size: 0.78rem !important; }

    /* ── GALLERY ── */
    .gallery-section { padding: 60px 0 !important; }
    .gallery-hero-header { padding: 0 16px !important; margin-bottom: 28px !important; }
    .gallery-hero-title { font-size: clamp(2rem, 10vw, 3.5rem) !important; }
    .gallery-hero-subtitle { font-size: 0.9rem !important; }
    .gallery-filters { gap: 8px !important; padding: 0 16px !important; flex-wrap: wrap !important; justify-content: center !important; margin-bottom: 20px !important; }
    .filter-btn { padding: 9px 18px !important; font-size: 0.82rem !important; }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 0 8px !important;
    }
    .gallery-item { border-radius: 8px !important; overflow: hidden !important; }
    .gallery-image { height: 160px !important; }
    .gallery-image img { height: 100% !important; width: 100% !important; object-fit: cover !important; }

    /* ── CONTACT ── */
    .contact-section { padding: 60px 0 !important; }
    .contact-container { grid-template-columns: 1fr !important; gap: 24px !important; }
    .contact-form-wrapper { padding: 24px 16px !important; border-radius: 16px !important; }
    .contact-info-card { padding: 24px 16px !important; border-radius: 16px !important; }
    .contact-form-wrapper .form-row { grid-template-columns: 1fr !important; gap: 0 !important; }
    .contact-info-card h3 { font-size: 1.3rem !important; margin-bottom: 8px !important; }
    .info-list { gap: 0 !important; }
    .info-item { padding: 14px 0 !important; border-bottom: 1px solid rgba(255,255,255,0.06) !important; }
    .info-item:last-child { border-bottom: none !important; }
    .info-icon { width: 38px !important; height: 38px !important; flex-shrink: 0 !important; border-radius: 10px !important; }
    .info-content h4 { font-size: 0.88rem !important; }
    .info-content p { font-size: 0.85rem !important; }
    .social-links { margin-top: 20px !important; }
    .tiktok-social-wrapper { justify-content: center !important; }
    .tiktok-label { font-size: 0.82rem !important; }

    /* Contact submit */
    #contact-form button[type="submit"] {
        width: 100% !important;
        justify-content: center !important;
        padding: 15px 20px !important;
    }

    /* ── FOOTER ── */
    .site-footer { padding-top: 56px !important; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 36px !important; margin-bottom: 36px !important; }
    .footer-column { text-align: left !important; }
    .footer-logo { gap: 10px !important; }
    .footer-title { font-size: 1rem !important; margin-bottom: 16px !important; }
    .footer-links { gap: 10px !important; }
    .footer-links a { font-size: 0.9rem !important; }
    .footer-contact li { font-size: 0.88rem !important; }
    .footer-bottom { padding: 20px 0 !important; }
    .footer-bottom-content { flex-direction: column !important; gap: 12px !important; text-align: center !important; }
    .footer-bottom-links { flex-wrap: wrap !important; justify-content: center !important; gap: 8px 12px !important; }
    .footer-bottom-links a { font-size: 0.8rem !important; }
    .copyright { font-size: 0.8rem !important; }

    /* ── BACK TO TOP ── */
    .back-to-top { bottom: 18px !important; right: 18px !important; width: 44px !important; height: 44px !important; }
}

/* =====================================================================
   SMALL MOBILE (max-width: 576px)
   ===================================================================== */
@media (max-width: 576px) {

    body { font-size: 15px; }
    .container { padding: 0 15px !important; }

    /* Header */
    .site-header { padding: 10px 0 !important; }
    .header-container { padding: 0 14px !important; }
    .site-logo { font-size: 1rem !important; gap: 7px !important; }
    .logo-icon, .logo-icon svg { width: 28px !important; height: 28px !important; }
    .mobile-menu-toggle { width: 40px !important; height: 40px !important; margin-left: auto !important; }

    /* Hero */
    .hero-section { min-height: 100svh !important; }
    .hero-content { padding: 80px 15px 40px !important; }
    .hero-title { font-size: clamp(1.6rem, 8vw, 2.4rem) !important; }
    .hero-subtitle { font-size: 0.87rem !important; margin-bottom: 20px !important; }
    .hero-actions { gap: 10px !important; }
    .hero-actions .btn { font-size: 0.9rem !important; padding: 14px 16px !important; }
    .hero-features-list { gap: 7px !important; }
    .feature-badge { font-size: 0.75rem !important; padding: 6px 11px !important; }

    /* TPS */
    .tps-wrap { padding: 50px 0 60px; }
    .tps-container { padding: 0 12px; }
    .tps-mos-main { height: 210px !important; }
    .tps-mos-sm { height: 85px !important; }
    .tps-info h3 { font-size: 1.15rem !important; }
    .tps-stat strong { font-size: 1.1rem !important; }
    .tps-badge { font-size: 0.72rem !important; padding: 5px 12px !important; }

    /* Services */
    .service-card { padding: 22px 16px !important; }

    /* Process */
    .timeline-content { padding: 18px 15px !important; }

    /* CEO Legend */
    .ceo-legend-section { padding: 56px 0 !important; }
    .ceo-legend-photo-wrap { width: 220px !important; height: 290px !important; }
    .ceo-legend-photo-ring--outer { width: 250px !important; height: 250px !important; top: 20px !important; left: -15px !important; }
    .ceo-legend-photo-ring--inner { width: 195px !important; height: 195px !important; }
    .ceo-legend-name { font-size: clamp(1.8rem, 8vw, 2.8rem) !important; }
    .ceo-legend-facts { padding: 16px 12px !important; }
    .clf-num { font-size: 24px !important; }
    .ceo-legend-fact-sep { height: 36px !important; }

    /* Calculator */
    .calculator-form { padding: 20px 14px !important; }
    .calculator-result { padding: 20px 14px !important; }
    .checkbox-group { grid-template-columns: 1fr 1fr !important; }

    /* Gallery — 1 column on small phones */
    .gallery-grid { grid-template-columns: 1fr !important; gap: 8px !important; padding: 0 12px !important; }
    .gallery-image { height: 200px !important; }

    /* Contact */
    .contact-form-wrapper, .contact-info-card { padding: 20px 14px !important; }

    /* Footer */
    .footer-grid { gap: 28px !important; }
    .back-to-top { bottom: 14px !important; right: 14px !important; }
}

/* =====================================================================
   EXTRA SMALL (max-width: 400px)
   ===================================================================== */
@media (max-width: 400px) {

    .container { padding: 0 12px !important; }
    .hero-content { padding: 76px 12px 36px !important; }
    .hero-title { font-size: clamp(1.5rem, 8.5vw, 2rem) !important; }

    /* TPS number smaller */
    .tps-proj-num { font-size: clamp(4rem, 18vw, 7rem) !important; }
    .tps-h2-num { font-size: clamp(2.5rem, 12vw, 4.5rem) !important; }

    .ceo-legend-name { font-size: clamp(1.6rem, 9vw, 2.4rem) !important; }
    .clf-num { font-size: 20px !important; }

    .section-title { font-size: 1.45rem !important; }
    .tps-mos-main { height: 185px !important; }
    .tps-mos-sm { height: 75px !important; }

    /* Gallery 1 column */
    .gallery-grid { grid-template-columns: 1fr !important; }
    .gallery-image { height: 185px !important; }
}

/* =====================================================================
   LANDSCAPE PHONE (max-width: 896px and landscape)
   ===================================================================== */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section { min-height: auto !important; padding: 80px 0 40px !important; }
    .hero-content { padding: 70px 20px 30px !important; }
    .hero-title { font-size: clamp(1.4rem, 4vw, 2rem) !important; }
}

/* =====================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ===================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* No hover states, no transforms */
    .btn:hover,
    .service-card:hover,
    .gallery-card:hover,
    .tps-cta:hover,
    .ceo-legend-cta:hover { transform: none !important; box-shadow: inherit !important; }

    /* Bigger tap targets */
    .nav-link { padding: 14px 0 !important; display: block !important; }
    .mobile-menu-toggle { width: 44px !important; height: 44px !important; padding: 10px !important; }
    .lang-btn, .lang-btn-mobile { padding: 10px 16px !important; min-width: 44px !important; min-height: 44px !important; }
    .back-to-top { width: 50px !important; height: 50px !important; }
    .filter-btn { min-height: 44px !important; }
    .checkbox-label { min-height: 44px !important; align-items: center !important; }

    /* Prevent double-tap zoom on buttons */
    .btn, a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

    /* Kill animations for performance */
    .hero-image { animation: none !important; transform: none !important; }
    @keyframes ceoRingPulse { 0%, 100% { opacity: 0.3; transform: scale(1); } }
    @keyframes pulseDot { 0%, 100% { transform: scale(1); } }
}
