/**
 * ELISIS Estética Automotiva 2.0
 * Responsive Engine (Breakpoints: 320px, 360px, 375px, 390px, 414px, 430px, 768px, 1024px, 1280px, 1440px, 1920px)
 */

/* ==========================================================================
   Telas Grandes (>= 1440px e 1920px)
   ========================================================================== */
@media (min-width: 1440px) {
  :root {
    --container-max: 1360px;
  }
}

@media (min-width: 1920px) {
  :root {
    --container-max: 1480px;
  }
}

/* ==========================================================================
   Desktops Médios e Laptops (< 1200px)
   ========================================================================== */
@media (max-width: 1200px) {

  .services-sporty-grid,
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .method-steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Tablets e Telas Médias (< 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .header-cta-group {
    gap: 10px;
  }

  .btn-header-cta {
    display: inline-flex;
    padding: 8px 16px;
    min-height: 38px;
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0.01em;
  }

  .btn-header-cta .header-cta-desktop {
    display: none;
  }

  .btn-header-cta .header-cta-mobile {
    display: inline;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-container,
  .hero-content {
    padding-left: clamp(32px, 5vw, 64px);
  }

  .hero-text-col {
    max-width: min(440px, 44vw);
  }

  .hero-title {
    font-size: clamp(1.35rem, 2.35vw, 1.85rem);
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-visual {
    max-width: 640px;
    margin: 0 auto;
  }

  .services-sporty-grid,
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .diff-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .footer-main-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }

  /* ==========================================================================
     CARROSSEL DA GALERIA — TABLET (2 Cartões Visíveis)
     ========================================================================== */
  .gallery-carousel-wrapper {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .gallery-carousel-viewport {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 310px;
  }

  .gallery-carousel-track {
    gap: 18px;
    align-items: stretch;
  }

  .gallery-item {
    flex: 0 0 calc((100% - 18px) / 2);
    min-width: 0;
  }

  .gallery-carousel-track.is-single-item .gallery-item {
    flex: 0 0 min(100%, 460px);
  }

  .gallery-media-box {
    height: 260px;
  }

  .gallery-nav-btn {
    position: static;
    transform: none;
    grid-row: 2;
    width: 42px;
    height: 42px;
  }

  .gallery-prev-btn {
    grid-column: 1;
  }

  .gallery-next-btn {
    grid-column: 3;
  }

  .gallery-nav-btn:hover:not(:disabled) {
    transform: scale(1.06);
  }

  .gallery-carousel-footer {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   Tablets Pequenos e Celulares Maiores (< 768px) — Padrão Mobile Top Car
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-h: 58px;
    --header-h-scrolled: 58px;
    --container-pad: 16px;
  }

  .site-header,
  .site-header.is-scrolled {
    height: var(--header-h);
    max-height: var(--header-h);
    background: #06080B;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }

  .header-corner-accent {
    display: none;
  }

  .header-brand {
    height: 100%;
    max-height: var(--header-h);
    overflow: hidden;
  }

  .header-brand picture,
  .header-brand-picture {
    height: 100%;
    display: inline-flex;
    align-items: center;
  }

  .header-brand img,
  .header-logo {
    height: 35px;
    max-height: 35px;
    width: auto;
    max-width: 104px;
    object-fit: contain;
  }

  .header-cta-group {
    gap: 8px;
  }

  .btn-header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    height: 36px;
    min-height: 36px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    border-radius: 9999px;
  }

  .btn-header-cta svg {
    width: 14px;
    height: 14px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #12151A;
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  .menu-toggle-bars {
    width: 18px;
    height: 12px;
  }

  .section {
    padding: clamp(52px, 8vw, 84px) 0;
  }

  /* HERO MOBILE — Mesma Estrutura, Altura Compacta e Sobreposição do Top Car */
  .hero,
  .hero-section {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding-top: calc(var(--header-h) + 42px);
    padding-bottom: 36px;
    background-color: #05080B;
  }

  .hero-blade-left,
  .hero-blade-right {
    display: none;
  }

  .hero-bg-media {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100% - var(--header-h));
    aspect-ratio: auto;
    overflow: hidden;
  }

  .hero-bg-media::after {
    display: none;
  }

  .hero-bg-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 62% 78%;
  }

  .hero-overlay {
    display: block;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background:
      linear-gradient(180deg,
        rgba(5, 8, 11, 0.94) 0%,
        rgba(5, 8, 11, 0.82) 38%,
        rgba(5, 8, 11, 0.44) 70%,
        rgba(5, 8, 11, 0.88) 100%),
      linear-gradient(90deg,
        rgba(5, 8, 11, 0.66) 0%,
        rgba(5, 8, 11, 0.22) 100%);
  }

  .hero-overlay-radial,
  .hero-transition-fade {
    display: none;
  }

  .hero-container,
  .hero-content {
    text-align: left;
    margin: 0 auto;
    padding-left: var(--container-pad, 16px);
    padding-right: var(--container-pad, 16px);
    max-width: 100%;
  }

  .hero-text-col {
    text-align: left;
    margin: 0;
    padding-left: 0;
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(1.22rem, 5.45vw, 1.56rem);
    line-height: 1.12;
    margin-bottom: 12px;
  }

  .hero-title span.accent,
  .hero-title .text-cyan {
    white-space: nowrap;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.48;
    color: #DCE4E9;
    margin: 0 0 18px 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .hero-actions .btn,
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    font-size: 0.84rem;
    justify-content: center;
  }

  /* SERVIÇOS ESPECIALIZADOS MOBILE (2 Colunas Lado a Lado como Top Car) */
  .services-sporty-section {
    padding: 28px 0 42px;
  }

  .sporty-header {
    margin-bottom: 18px;
  }

  .sporty-label {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    margin-bottom: 4px;
  }

  .sporty-title,
  .services-sporty-section .section-title {
    font-size: clamp(1.02rem, 4.8vw, 1.38rem);
    white-space: nowrap;
    word-break: keep-all;
    word-wrap: normal;
    overflow-wrap: normal;
    hyphens: none;
    letter-spacing: 0.02em;
  }

  .services-sporty-grid,
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .service-sporty-card {
    padding: 14px 10px;
    border-radius: 12px;
    min-height: 168px;
  }

  .service-sporty-media {
    margin-bottom: 10px;
    padding: 0 2px;
  }

  .service-sporty-icon {
    width: 32px;
    height: 32px;
  }

  .service-sporty-icon svg {
    width: 24px;
    height: 24px;
  }

  .service-sporty-photo {
    width: 60px;
    height: 45px;
  }

  .service-sporty-title {
    font-size: 0.86rem;
  }

  .service-sporty-desc {
    font-size: 0.74rem;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .method-steps-grid {
    grid-template-columns: 1fr;
  }

  .diff-grid {
    grid-template-columns: 1fr;
  }

  .instagram-cta-strip {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .ig-cta-left {
    flex-direction: column;
  }

  .instagram-cta-strip .btn {
    width: 100%;
  }

  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-copyright {
    text-align: center;
  }

  .footer-signature-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }

  .ruan-signature-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
  }

  .ruan-tagline {
    font-size: 0.78rem;
  }

  .ruan-signature-badge {
    padding: 4px 10px;
    border-radius: 8px;
  }

  .ruan-signature-img {
    height: 20px;
    max-width: 86px;
    object-fit: contain;
  }

  .testi-card {
    width: clamp(260px, 86vw, 350px);
    max-width: calc(100vw - 32px);
    height: 360px;
  }

  .testi-card-face {
    padding: 24px 20px;
    gap: 14px;
  }

  .testi-body {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .testi-track-wrap {
    padding: 20px 0 26px;
  }

  .modal-box {
    padding: 24px 18px;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .lightbox-modal {
    padding: calc(max(26px, env(safe-area-inset-top, 0px)) + 52px) max(14px, env(safe-area-inset-right, 0px)) calc(max(16px, env(safe-area-inset-bottom, 0px)) + 16px) max(14px, env(safe-area-inset-left, 0px));
  }

  .lightbox-content,
  .lightbox-content-box {
    position: relative;
  }

  .lightbox-btn,
  .lightbox-close-btn,
  .lightbox-nav-btn {
    width: 44px;
    height: 44px;
  }

  .lightbox-btn::after {
    inset: -7px;
  }

  .lightbox-btn svg {
    width: 16px;
    height: 16px;
  }

  .lightbox-btn.close,
  .lightbox-close-btn {
    top: max(16px, calc(env(safe-area-inset-top, 0px) + 14px));
    right: max(14px, calc(env(safe-area-inset-right, 0px) + 14px));
  }

  .lightbox-btn.prev,
  .lightbox-nav-btn.prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-btn.next,
  .lightbox-nav-btn.next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-btn.close:active,
  .lightbox-close-btn:active {
    transform: scale(0.95);
  }

  .lightbox-btn.prev:active,
  .lightbox-btn.next:active,
  .lightbox-nav-btn.prev:active,
  .lightbox-nav-btn.next:active {
    transform: translateY(-50%) scale(0.95);
  }

  .location-map-card,
  .location-map-card iframe {
    min-height: 320px;
  }

  .map-overlay-badge {
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .route-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .route-actions .btn {
    min-height: 44px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Celulares Pequenos e Médios (320px até 480px)
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    --container-pad: 16px;
  }

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 6.5vw, 1.85rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .ba-label {
    top: 12px;
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .ba-label.before {
    left: 12px;
  }

  .ba-label.after {
    right: 12px;
  }

  .ba-handle-grip {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .faq-trigger {
    padding: 18px 20px;
    font-size: 0.95rem;
  }

  .faq-answer-inner {
    padding: 0 20px 20px 20px;
  }

  .about-stat-floating {
    position: static;
    margin-top: 16px;
    width: 100%;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .route-actions {
    flex-direction: column;
  }

  .route-actions .btn {
    width: 100%;
  }

  .lightbox-btn {
    width: 35px;
    height: 35px;
  }

  .lightbox-btn svg {
    width: 15px;
    height: 15px;
  }

  .lightbox-btn.close {
    top: max(24px, calc(env(safe-area-inset-top, 0px) + 18px));
    right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px));
  }

  .lightbox-btn.prev {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-btn.next {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ==========================================================================
   Refinamentos de Contato, Glassmorphism & Proteção Anti-Overflow
   ========================================================================== */
@media (max-width: 768px) {
  .contact-section {
    padding: clamp(60px, 9vw, 90px) 0;
  }

  .contact-title {
    font-size: clamp(2rem, 6.5vw, 2.75rem);
  }

  .contact-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .location-info-card {
    padding: 26px 20px;
  }
}

@media (max-width: 480px) {
  .btn-contact-hero {
    width: 100%;
    padding: 16px 20px;
    font-size: 0.9rem;
    gap: 10px;
  }

  .contact-method-card {
    padding: 16px 18px;
    gap: 14px;
  }

  .location-info-card {
    padding: 22px 16px !important;
    border-radius: 20px !important;
  }
}

/* Escalonamento Responsivo do Fundo Secundário Automotivo Ciano */
@media (max-width: 1024px) {
  .site-honeycomb-bg {
    background-size: cover;
    background-attachment: scroll;
  }
}

@media (max-width: 768px) {
  .site-honeycomb-bg {
    background-image: url("../img/bg-elisis-cyan-v2.jpg?v=20261116");
    background-image: image-set(
      url("../img/bg-elisis-cyan-v2.webp?v=20261116") type("image/webp"),
      url("../img/bg-elisis-cyan-v2.jpg?v=20261116") type("image/jpeg")
    );
    background-size: 100% auto;
    background-position: top center;
    background-repeat: repeat-y;
    background-attachment: scroll;
  }

  .services-sporty-section,
  #sobre,
  #antes-depois,
  #galeria,
  #avaliacoes,
  #faq,
  #localizacao,
  #contato {
    background-image:
      linear-gradient(180deg, rgba(4, 7, 10, 0.36) 0%, rgba(4, 7, 10, 0.10) 20%, rgba(4, 7, 10, 0.10) 80%, rgba(4, 7, 10, 0.36) 100%),
      url("../img/bg-elisis-cyan-v2.jpg?v=20261116");
    background-image:
      linear-gradient(180deg, rgba(4, 7, 10, 0.36) 0%, rgba(4, 7, 10, 0.10) 20%, rgba(4, 7, 10, 0.10) 80%, rgba(4, 7, 10, 0.36) 100%),
      image-set(
        url("../img/bg-elisis-cyan-v2.webp?v=20261116") type("image/webp"),
        url("../img/bg-elisis-cyan-v2.jpg?v=20261116") type("image/jpeg")
      );
    background-size: 100% auto;
    background-position: top center;
    background-repeat: repeat-y;
  }

  .site-footer {
    background-image:
      linear-gradient(180deg, rgba(4, 7, 10, 0.62) 0%, rgba(3, 5, 8, 0.82) 100%),
      url("../img/bg-elisis-cyan-v2.jpg?v=20261116");
    background-image:
      linear-gradient(180deg, rgba(4, 7, 10, 0.62) 0%, rgba(3, 5, 8, 0.82) 100%),
      image-set(
        url("../img/bg-elisis-cyan-v2.webp?v=20261116") type("image/webp"),
        url("../img/bg-elisis-cyan-v2.jpg?v=20261116") type("image/jpeg")
      );
    background-size: 100% auto;
    background-repeat: repeat-y;
  }
}

/* ==========================================================================
   CARROSSEL DA GALERIA — SMARTPHONE (1 Cartão Visível Completo)
   Garante 0% de bug de desaparecimento em dispositivos móveis
   ========================================================================== */
@media (max-width: 639px) {
  .gallery-filters {
    gap: 8px;
    margin-bottom: 24px;
  }

  .gallery-filter-btn {
    padding: 7px 14px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .gallery-carousel-viewport {
    min-height: 320px;
    width: 100%;
  }

  .gallery-carousel-track {
    width: 100%;
    gap: 14px;
    align-items: stretch;
  }

  /* 1 cartão visível completo no mobile */
  .gallery-item {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    opacity: 1;
  }

  .gallery-carousel-track.is-single-item .gallery-item {
    flex: 0 0 100%;
  }

  .gallery-media-box {
    height: 240px;
  }

  .gallery-card-info {
    padding: 12px 14px;
    min-height: 76px;
  }

  .gallery-card-title {
    font-size: 0.92rem;
  }

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
  }

  .gallery-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .gallery-carousel-footer {
    gap: 8px;
  }

  .gallery-pagination-indicator {
    font-size: 0.78rem;
    padding: 4px 10px;
  }
}

/* ==========================================================================
   Telas Compactas e Ultra-Pequenas (320px até 360px)
   ========================================================================== */
@media (max-width: 360px) {
  :root {
    --container-pad: 12px;
    --page-gutter: 12px;
  }

  .header-brand img,
  .header-logo {
    height: 30px;
    max-height: 30px;
  }

  .btn-header-cta {
    padding: 0 10px;
    height: 34px;
    min-height: 34px;
    font-size: 0.72rem;
  }

  .menu-toggle {
    width: 36px;
    height: 36px;
  }

  .hero-title {
    font-size: clamp(1.08rem, 5.2vw, 1.24rem);
  }

  .hero-title span.accent,
  .hero-title .text-cyan {
    white-space: normal;
  }

  .hero-subtitle {
    font-size: 0.84rem;
  }

  .sporty-title,
  .services-sporty-section .section-title {
    font-size: clamp(0.90rem, 4.3vw, 1.15rem);
    white-space: nowrap;
    word-break: keep-all;
    letter-spacing: 0;
  }

  .services-sporty-grid,
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .service-sporty-card {
    padding: 12px 8px;
    min-height: 158px;
  }

  .service-sporty-photo {
    width: 50px;
    height: 38px;
  }

  .service-sporty-title {
    font-size: 0.8rem;
  }

  .service-sporty-desc {
    font-size: 0.7rem;
  }

  .btn {
    padding: 12px 18px;
    font-size: 0.85rem;
    white-space: normal;
  }

  .testi-card {
    width: calc(100vw - 24px);
  }

  .modal-box {
    padding: 20px 14px;
  }

  .location-info-card {
    padding: 18px 12px !important;
  }

  .gallery-item {
    flex: 0 0 100%;
    width: 100%;
  }

  .gallery-media-box {
    height: 215px;
  }

  .gallery-nav-btn {
    width: 36px;
    height: 36px;
  }

  .lightbox-btn,
  .lightbox-close-btn,
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
  }

  .lightbox-btn svg {
    width: 14px;
    height: 14px;
  }

  .lightbox-btn.close,
  .lightbox-close-btn {
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 12px));
    right: max(12px, calc(env(safe-area-inset-right, 0px) + 12px));
  }

  .lightbox-btn.prev,
  .lightbox-nav-btn.prev {
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-btn.next,
  .lightbox-nav-btn.next {
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* Proteção Estrita Contra Overflow Horizontal Sem Afetar Elementos Fixed */
html {
  overflow-x: clip;
}
body {
  max-width: 100vw;
  overflow-x: clip;
}

/* ==========================================================================
   Acessibilidade: Redução de Movimento (prefers-reduced-motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .testi-card {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }

  .testi-track-wrap {
    perspective: none !important;
  }

  .testi-status-dot {
    animation: none !important;
  }

  .footer-hex-overlay {
    animation: none !important;
  }
}