/**
 * Mobil və kiçik planşet — UX, toxunma sahələri, overflow.
 */

@media (max-width: 991.98px) {
  :root {
    --tt-mobile-gutter: clamp(1rem, 4.5vw, 1.35rem);
  }

  .container,
  .custom-container {
    padding-left: var(--tt-mobile-gutter) !important;
    padding-right: var(--tt-mobile-gutter) !important;
  }

  /* Bölmə boşluqları */
  section,
  .coolair-legacy-root section {
    padding-top: clamp(3rem, 8vw, 4.5rem) !important;
    padding-bottom: clamp(3rem, 8vw, 4.5rem) !important;
  }

  .portfolio-page-intro,
  .portfolio-projects-section,
  .ca-portfolio-section {
    padding-top: clamp(2rem, 6vw, 3rem) !important;
    padding-bottom: clamp(2rem, 6vw, 3rem) !important;
  }

  .section-title {
    font-size: clamp(1.65rem, 6.2vw, 2.15rem) !important;
    line-height: 1.15 !important;
  }

  .lead,
  p[style*='font-size:17px'] {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  /* Düymələr — tam en, toxunma */
  .theme-btn,
  .btn-main,
  a.theme-btn {
    min-height: 48px;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .hero-area-2 .aslider--btn,
  .ca-hero-cta-row,
  .portfolio-detail-hero .theme-btn,
  .home-bottom-cta .wow.fadeInUp {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-area-2 .aslider--btn .theme-btn,
  .hero-area-2 .aslider--btn a.theme-btn,
  .ca-hero-cta-row .theme-btn,
  .ca-hero-cta-row a.theme-btn,
  .portfolio-detail-hero a.theme-btn,
  .home-bottom-cta a.theme-btn {
    width: 100% !important;
    margin: 0 !important;
  }

  /* ---------- Header / menyu ---------- */
  header.header-s1.header-mobile {
    background: #fff !important;
  }

  header.header-s1.header-mobile #menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    color: var(--tt-navy, #0f172a) !important;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f8fafc;
    flex-shrink: 0;
  }

  header.header-s1.header-mobile.menu-open {
    position: fixed !important;
    inset: 0;
    z-index: 10050;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff !important;
    height: 100dvh !important;
    max-height: 100dvh;
  }

  header.header-s1.header-mobile.menu-open #topbar {
    flex-shrink: 0;
  }

  header.header-s1.header-mobile .de-flex.sm-pt10 {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  header.header-s1.header-mobile .header-col-mid {
    flex: 1 1 100% !important;
    order: 10;
    width: 100% !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
  }

  header.header-s1.header-mobile.menu-open .header-col-mid {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    opacity: 1;
    padding: 0.5rem 0 1.5rem;
  }

  header.header-s1.header-mobile #mainmenu {
    display: block !important;
    position: static !important;
    float: none !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  header.header-s1.header-mobile #mainmenu > li {
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  }

  header.header-s1.header-light.header-mobile #mainmenu a.menu-item {
    padding: 14px 8px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: var(--tt-navy) !important;
    min-height: 48px;
    display: flex !important;
    align-items: center;
  }

  /* Topbar — telefon görünsün */
  header.header-s1 .ca-topbar-left {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  header.header-s1 .ca-topbar-left .topbar-widget:first-child a {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
  }

  header.header-s1 .ca-topbar-row {
    flex-wrap: nowrap;
    justify-content: space-between !important;
  }

  header.header-s1 .ca-topbar-right {
    flex-shrink: 0;
  }

  /* ---------- Hero ---------- */
  .ca-hero-split-wrap {
    padding-top: 0.75rem !important;
    padding-bottom: 1.5rem !important;
  }

  .ca-hero-split {
    min-height: 0 !important;
  }

  .ca-hero-split__text .aslider--title {
    font-size: clamp(1.75rem, 8vw, 2.35rem) !important;
    line-height: 1.1 !important;
    margin-bottom: 1rem !important;
  }

  .ca-hero-split__text .aslider--subtitle p {
    font-size: 0.9rem !important;
    margin-bottom: 0.35rem;
  }

  .ca-hero-split__text .hero__icon1 {
    display: none;
  }

  .ca-hero-visual-frame {
    border-radius: 20px;
    padding: 0.4rem;
  }

  .ca-hero-slide {
    aspect-ratio: 16 / 10;
    max-height: 280px;
  }

  .ca-hero-swiper-ui .swiper-button-prev,
  .ca-hero-swiper-ui .swiper-button-next {
    width: 40px;
    height: 40px;
  }

  /* Xidmət kartları */
  .ca-home-service-card {
    margin-bottom: 0.5rem;
  }

  .ca-home-service-image-wrap {
    aspect-ratio: 16 / 10;
    max-height: 200px;
  }

  .ca-home-service-text {
    padding: 1rem 1.1rem 1.15rem !important;
  }

  .ca-home-service-title {
    font-size: 1.05rem !important;
  }

  /* Portfolio */
  .portfolio-list-card__body,
  .ca-portfolio-card__body {
    padding: 1.1rem 1.15rem 1.25rem !important;
  }

  .portfolio-list-card__title,
  .ca-portfolio-card__title {
    font-size: 1.05rem !important;
  }

  /* Layihə detalı */
  .portfolio-detail-hero .row {
    flex-direction: column-reverse;
  }

  .portfolio-detail-hero__media {
    max-height: min(280px, 48vh);
    aspect-ratio: 16 / 10;
  }

  .portfolio-detail-hero h1.section-title {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem) !important;
  }

  /* Footer */
  .ca-footer-root .ca-site-footer {
    padding: 3.5rem 0 2rem !important;
  }

  .ca-footer-grid > [class*='col-'] {
    margin-bottom: 1.75rem;
  }

  .ca-footer-brands-heading {
    font-size: 1.05rem !important;
    padding-bottom: 0.85rem !important;
  }

  /* Rəylər karusel */
  .ca-testimonials .container-fluid {
    padding-left: var(--tt-mobile-gutter);
    padding-right: var(--tt-mobile-gutter);
  }

  .ca-testimonial-card {
    padding: 1.25rem 1rem !important;
  }

  /* Legacy portfel / xidmət */
  .coolair-legacy-root .portfolio-scope-card,
  .coolair-legacy-root .ablog {
    margin-bottom: 0.5rem;
  }

  .coolair-legacy-root .service-detail-hero .row {
    flex-direction: column-reverse;
  }

  /* Yuxarı keçid */
  .float-text {
    left: auto !important;
    right: 1rem !important;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
  }

  .float-text a {
    font-size: 11px;
    padding: 0.5rem 0.65rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  .scrollbar-v {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  header.header-s1 .ca-topbar-email,
  header.header-s1 .ca-topbar-hours {
    display: none !important;
  }

  header.header-s1 a.ca-site-brand__mark {
    height: 42px;
    width: min(168px, 46vw);
  }

  .hero-area-2 {
    min-height: 0 !important;
  }

  .spacer-single {
    height: 1.5rem !important;
  }

  .portfolio-scope .col-md-6.col-lg-4 {
    margin-bottom: 0.25rem;
  }
}

/* Sabit zəng düyməsi */
.ca-mobile-call-fab {
  display: none;
}

@media (max-width: 991.98px) {
  .ca-mobile-call-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: fixed;
    z-index: 10040;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    min-height: 52px;
    padding: 0 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none !important;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.45);
    border: none;
    -webkit-tap-highlight-color: transparent;
  }

  .ca-mobile-call-fab i {
    font-size: 1.15rem;
  }

  .ca-mobile-call-fab:active {
    transform: scale(0.97);
  }

  body:has(header.header-mobile.menu-open) .ca-mobile-call-fab {
    display: none;
  }
}

@media (max-width: 380px) {
  .ca-mobile-call-fab span {
    display: none;
  }

  .ca-mobile-call-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }
}

/* Köhnə məzmun səhifələri (about, contact, services, FAQ) */
@media (max-width: 991.98px) {
  .coolair-legacy-root img,
  .coolair-legacy-root iframe,
  .legacy-html-inject img,
  .legacy-html-inject iframe {
    max-width: 100%;
    height: auto;
  }

  .coolair-legacy-root .google-map {
    min-height: 220px;
    aspect-ratio: 16 / 10;
    border-radius: var(--tt-radius);
    overflow: hidden;
  }

  .coolair-legacy-root .google-map iframe {
    width: 100%;
    height: 100%;
    min-height: 220px;
  }

  .coolair-legacy-root .ablog,
  .coolair-legacy-root .service-detail-hero {
    margin-bottom: 1.25rem;
  }

  .coolair-legacy-root .contact-info .box-wraper {
    margin-bottom: 1rem;
  }

  .coolair-legacy-root table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portfolio-detail-breadcrumb {
    padding-top: 5.5rem !important;
    padding-bottom: 0.75rem !important;
  }

  h1.section-title {
    font-size: clamp(1.5rem, 5.8vw, 2rem) !important;
    line-height: 1.15 !important;
  }
}

/* Design demo (/design/) */
@media (max-width: 991.98px) {
  .cf-theme .cf-wrap {
    padding-left: var(--tt-mobile-gutter, 1rem);
    padding-right: var(--tt-mobile-gutter, 1rem);
  }

  .cf-header__inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .cf-mobile {
    width: 100%;
  }
}
