/* ============================================================
   RR Autopeças — Responsividade (mobile-first)
   ============================================================ */

/* ── Breakpoints usados:
   sm:  480px
   md:  768px
   lg:  1024px
   xl:  1280px
   ──────────────────────────────────────────────────────────── */

/* ── lg: até 1024px — tablets ─────────────────────────────── */

@media (max-width: 1024px) {

  .differentials-layout,
  .mechanics-layout,
  .about-layout,
  .location-layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .differentials-layout > *:first-child {
    order: 2;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .reviews-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-title {
    font-size: clamp(var(--text-4xl), 5.5vw, var(--text-6xl));
  }

  .section-title {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  }

  .reviews-cta {
    padding: var(--space-8) var(--space-8);
  }
}

@media (max-width: 768px) {

  /* Header height mobile */
  :root {
    --header-height: 72px;
  }

  /* Header */
  .header-nav,
  .header-phone {
    display: none;
  }

  .menu-burger {
    display: flex;
  }

  .header-actions .btn {
    display: none;
  }

  /* Hero */
  .hero {
    min-height: 100svh;
  }

  .hero-content {
    padding-block: var(--space-12);
  }

  .hero-stats {
    gap: var(--space-6);
  }

  .hero-stat-value {
    font-size: var(--text-2xl);
  }

  .hero-description {
    font-size: var(--text-base);
    max-width: 100%;
  }

  /* Stats bar */
  .stats-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .stats-bar-divider {
    display: none;
  }

  /* Search */
  .search-form {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .search-btn {
    border-radius: 0;
    justify-content: center;
    padding: var(--space-4);
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  /* Reviews — scroll-snap carousel no mobile */
  .reviews-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .reviews-grid::-webkit-scrollbar {
    display: none;
  }

  .review-card {
    flex: 0 0 calc(100vw - var(--container-px) * 2 - var(--space-4));
    max-width: calc(100vw - var(--container-px) * 2 - var(--space-4));
    scroll-snap-align: start;
  }

  .reviews-cta {
    padding: var(--space-8) var(--space-6);
  }

  /* Footer */
  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-desc {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Reduzir padding de seções para diminuir altura total no mobile */
  .search-section {
    padding-block: var(--space-10);
  }

  .page-hero {
    min-height: auto;
    padding: 90px 0 40px;
  }

  .final-cta {
    padding-block: var(--space-16);
  }

  /* Final CTA */
  .final-cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .final-cta-buttons .btn {
    width: 100%;
    max-width: 360px;
  }

  .final-cta-title {
    font-size: var(--text-3xl);
  }

  /* About highlights */
  .about-highlights {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About image secondary */
  .about-img-secondary {
    display: none;
  }

  .about-images {
    overflow: hidden;
    padding-bottom: 0;
  }

  /* Location map */
  .location-map {
    height: 320px;
  }

  /* Mechanics features slide effect — disable on mobile */
  .mechanics-feature:hover {
    transform: none;
  }
}

@media (max-width: 480px) {

  /* Base adjustments */
  :root {
    --container-px: 1rem;
    --space-20: 2.5rem;
    --space-24: 3rem;
  }

  /* Logo: hide tagline on very small screens */
  .header-logo-tagline {
    display: none;
  }
  .logo-mark {
    width: 36px;
    height: 36px;
  }

  /* Hero */
  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-scroll {
    display: none;
  }

  /* Hero stats — grid compacto 2x2 */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    padding-top: var(--space-5);
  }

  .hero-stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-3);
  }

  .hero-stat-value {
    font-size: var(--text-2xl);
  }

  .hero-stat-label {
    font-size: 10px;
  }

  /* Categories — manter 2 colunas compactas */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .category-card {
    padding: var(--space-4) var(--space-3);
    gap: var(--space-2);
  }

  .category-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .category-name {
    font-size: var(--text-sm);
  }

  .category-desc {
    display: none;
  }

  /* Stats bar — grid 2x2 em telas muito pequenas */
  .stats-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    align-items: start;
  }

  .stats-bar-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .stats-bar-item {
    gap: var(--space-2);
  }

  /* Section headers */
  .section-title {
    font-size: var(--text-3xl);
    letter-spacing: -0.015em;
  }

  .section-subtitle {
    font-size: var(--text-base);
  }

  /* Differentials */
  .differentials-image-badge {
    left: var(--space-4);
    bottom: var(--space-4);
    right: var(--space-4);
    padding: var(--space-3) var(--space-4);
  }

  /* About highlights */
  .about-highlights {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  /* WhatsApp float */
  .whatsapp-float {
    bottom: var(--space-4);
    right: var(--space-4);
  }

  .whatsapp-float-btn {
    width: 54px;
    height: 54px;
  }

  /* Brand logos */
  .brand-logo-item {
    min-width: 80px;
    padding: var(--space-3) var(--space-4);
  }

  /* Mechanics card */
  .mechanics-card {
    padding: var(--space-6);
  }

  /* Reviews CTA */
  .reviews-cta {
    padding: var(--space-6) var(--space-4);
  }

  /* Location map */
  .location-map {
    height: 280px;
  }

  /* Search hints */
  .search-hints {
    gap: var(--space-2);
  }
}

/* ── Melhorias para telas muito grandes ─────────────────── */

@media (min-width: 1400px) {
  :root {
    --max-width: 1360px;
  }

  .hero-title {
    font-size: var(--text-7xl);
  }

  .section-title {
    font-size: var(--text-5xl);
  }

  .hero-description {
    font-size: var(--text-xl);
    max-width: 560px;
  }
}

/* ── Orientação paisagem em mobile ──────────────────────── */

@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-block: var(--space-12);
  }
}

/* ── Dark mode seguro (já é dark por padrão) ────────────── */

@media (prefers-color-scheme: light) {
  /* Site é dark por design de marca — não altera */
}

/* ── Print ──────────────────────────────────────────────── */

@media print {
  #header,
  .whatsapp-float,
  .hero-scroll,
  .mobile-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}


@media (max-width: 768px) {
  .header-logo-image {
    width: clamp(138px, 42vw, 170px);
    height: auto;
    max-height: none;
  }

  .footer-logo-image,
  .footer-logo img {
    width: 180px;
    max-height: 36px;
  }
}

@media (max-width: 420px) {
  .header-logo-image {
    width: 138px;
    height: auto;
    max-height: none;
  }
}

/* ============================================================
   HOTFIX V20 — Mobile sem quebrar desktop
   Mantém o desktop original e aplica ajustes somente no mobile.
   ============================================================ */

/* Segurança global contra largura extra */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

@supports not (overflow-x: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 76px;
    --container-px: 1rem;
  }

  body,
  main,
  section,
  .section,
  .container,
  .header-inner,
  .footer,
  .mobile-nav {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Header mobile: logo média + botão sempre dentro da tela */
  #header {
    min-height: var(--header-height);
    overflow: visible;
  }

  .header-inner {
    min-height: var(--header-height);
    height: var(--header-height);
    padding: 8px var(--container-px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: visible;
  }

  .header-logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100vw - 86px);
    transform: none !important;
  }

  .header-logo-image {
    width: clamp(152px, 44vw, 188px) !important;
    max-width: calc(100vw - 96px) !important;
    height: auto !important;
    max-height: 54px !important;
    object-fit: contain;
    object-position: left center;
  }

  .header-nav,
  .header-phone,
  .header-actions .btn {
    display: none !important;
  }

  .header-actions {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transform: none !important;
  }

  .menu-burger {
    display: inline-flex !important;
    position: relative;
    z-index: calc(var(--z-header) + 2);
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin: 0;
  }

  /* Menu mobile: abre dentro da largura real da tela */
  .mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: auto;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    padding: 20px 16px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translate3d(100%, 0, 0);
    box-sizing: border-box;
  }

  .mobile-nav.is-open {
    transform: translate3d(0, 0, 0);
  }

  .mobile-nav-link {
    width: 100%;
    box-sizing: border-box;
  }

  /* Reduz comprimento geral sem afetar desktop */
  .section {
    padding-block: 48px;
  }

  .section-header {
    margin-bottom: 28px;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 34px;
  }

  .hero-content {
    padding-block: 28px 18px;
  }

  .hero-eyebrow {
    margin-bottom: 20px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1.08;
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 1rem;
    line-height: 1.58;
    margin-bottom: 24px;
  }

  .hero-ctas {
    margin-bottom: 24px;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 18px;
  }

  .hero-stat {
    min-width: 0;
    padding: 12px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
  }

  .hero-stat-value {
    font-size: 1.35rem;
  }

  .hero-stat-label {
    font-size: 9px;
    line-height: 1.25;
  }

  .stats-bar {
    padding-block: 18px;
  }

  .stats-bar-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stats-bar-item {
    min-width: 0;
  }

  .stats-bar-divider {
    display: none !important;
  }

  /* Peças: carrossel só no mobile, desktop permanece grid */
  .categories-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 0 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .categories-grid::-webkit-scrollbar {
    display: none;
  }

  .category-card {
    flex: 0 0 78%;
    max-width: 78%;
    min-height: 180px;
    scroll-snap-align: start;
    padding: 18px;
  }

  /* Marcas: mais rápido e compacto */
  .brands-section {
    padding-block: 42px;
  }

  .brands-scroll {
    padding-block: 16px;
  }

  .brand-logo-item {
    min-width: 92px;
    padding: 12px 14px;
  }

  /* Seções longas mais compactas */
  .differentials-layout,
  .mechanics-layout,
  .about-layout,
  .location-layout {
    gap: 28px;
  }

  .mechanics-features,
  .mechanics-card-benefits {
    gap: 10px;
    margin-bottom: 20px;
  }

  .mechanics-feature {
    padding: 12px 14px;
  }

  .mechanics-card {
    padding: 20px;
  }

  .mechanics-image {
    min-height: 230px;
    max-height: 320px;
  }

  .about-content p {
    margin-bottom: 14px;
    line-height: 1.6;
  }

  .about-highlights {
    margin-top: 20px;
    margin-bottom: 22px;
    gap: 12px;
  }

  .about-highlight {
    padding: 16px 12px;
  }

  .about-highlight-value {
    font-size: 1.8rem;
  }

  /* Depoimentos: carrossel só no mobile */
  .reviews-grid {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .reviews-grid::-webkit-scrollbar {
    display: none;
  }

  .review-card {
    flex: 0 0 86%;
    max-width: 86%;
    scroll-snap-align: start;
  }

  .reviews-cta {
    padding: 28px 18px;
  }

  .location-map,
  .map-container,
  iframe {
    max-width: 100%;
    overflow: hidden;
  }

  .location-map {
    height: 300px;
  }

  .final-cta {
    padding-block: 46px;
  }

  .footer {
    overflow: hidden;
  }

  .footer-main {
    gap: 26px;
  }

  .footer-logo-image,
  .footer-logo img,
  .footer-brand .footer-logo-image,
  .footer-brand img.footer-logo-image {
    width: 200px !important;
    max-width: 70vw !important;
  }

  .whatsapp-float {
    right: 14px;
    bottom: 14px;
    z-index: calc(var(--z-header) + 5);
  }
}

@media (max-width: 430px) {
  .header-logo-image {
    width: clamp(148px, 48vw, 172px) !important;
    max-height: 50px !important;
  }

  .menu-burger {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .section {
    padding-block: 40px;
  }

  .category-card {
    flex-basis: 84%;
    max-width: 84%;
  }

  .review-card {
    flex-basis: 88%;
    max-width: 88%;
  }

  .hero-title {
    font-size: clamp(1.95rem, 10.5vw, 2.65rem);
  }
}

@media (max-width: 360px) {
  .header-logo-image {
    width: 140px !important;
  }

  .category-card,
  .review-card {
    flex-basis: 90%;
    max-width: 90%;
  }
}

/* ============================================================
   AJUSTE FINAL — LOGOS MOBILE PADRONIZADAS
   Mantém header dentro da tela e deixa logos com presença média.
   ============================================================ */
@media (max-width: 768px) {
  .header-logo,
  .footer-logo {
    flex-shrink: 0 !important;
    overflow: visible !important;
  }

  .header-logo-image,
  .footer-logo-image,
  .footer-logo img,
  .footer-brand .footer-logo-image,
  .footer-brand img.footer-logo-image {
    width: clamp(178px, 45vw, 198px) !important;
    max-width: clamp(178px, 45vw, 198px) !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  .header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  .menu-burger {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    margin-left: auto !important;
  }
}

@media (max-width: 430px) {
  .header-logo-image,
  .footer-logo-image,
  .footer-logo img,
  .footer-brand .footer-logo-image,
  .footer-brand img.footer-logo-image {
    width: clamp(168px, 50vw, 186px) !important;
    max-width: clamp(168px, 50vw, 186px) !important;
  }
}

@media (max-width: 360px) {
  .header-logo-image,
  .footer-logo-image,
  .footer-logo img,
  .footer-brand .footer-logo-image,
  .footer-brand img.footer-logo-image {
    width: 164px !important;
    max-width: 164px !important;
  }

  .header-inner {
    gap: 8px !important;
  }

  .menu-burger {
    flex-basis: 42px !important;
    width: 42px !important;
    height: 42px !important;
  }
}

/* ============================================================
   AJUSTE FINAL — SACOLINHA VISÍVEL NO MOBILE
   A imagem saiu do card absoluto e entra como bloco normal no fluxo.
   Isso evita sumir por overflow, z-index ou corte do container.
   ============================================================ */
.about-bag-mobile {
  display: none;
}

@media (max-width: 768px) {
  .about-img-secondary {
    display: none !important;
  }

  .about-images {
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }

  .about-bag-mobile {
    display: block !important;
    width: 100%;
    max-width: 420px;
    margin: 22px auto 18px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.03);
  }

  .about-bag-mobile img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 430px) {
  .about-bag-mobile {
    max-width: 100%;
    margin: 18px 0 16px;
    border-radius: 18px;
  }
}
