/* ================================================
   TERRACORE — MOBILE (iPhone 17 / 393px)
   Baseado exatamente no preview aprovado
   ================================================ */

/* Hamburger — sempre visível no mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media screen and (max-width: 768px) {

  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* ===== NAV ===== */
  nav {
    padding: 0 4% !important;
    height: 56px !important;
  }

  .nav-phone { display: none !important; }

  .hamburger { display: flex !important; }

  .nav-menu {
    display: none !important;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important; right: 0 !important;
    background: rgba(26,46,26,0.98) !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 12px 0 20px !important;
    z-index: 999 !important;
    gap: 0 !important;
  }
  .nav-menu.open { display: flex !important; }

  .nav-link {
    padding: 14px 24px !important;
    font-size: 15px !important;
    width: 100% !important;
    display: block !important;
  }

  .dropdown-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255,255,255,0.05) !important;
    border-radius: 0 !important;
    min-width: unset !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .dropdown-item {
    padding: 10px 40px !important;
    font-size: 13px !important;
    color: rgba(255,255,255,0.65) !important;
  }

  /* ===== HERO ===== */
  .hero {
    padding: 80px 20px 40px !important;
    background-attachment: scroll !important;
    overflow-x: hidden !important;
    margin-top: 0 !important;
  }

  .hero h1 {
    font-size: 32px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 14px !important;
  }

  .hero p {
    font-size: 13px !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
    margin-bottom: 24px !important;
  }

  .hero-ctas {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  .btn-primary, .btn-outline {
    text-align: center !important;
    padding: 13px 20px !important;
    font-size: 13px !important;
    width: 100% !important;
  }

  .hero-stats {
    display: flex !important;
    gap: 20px !important;
    margin-top: 28px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }

  .hero-stat-num { font-size: 26px !important; }
  .hero-stat-label { font-size: 10px !important; }

  .hero-bg-img {
    left: 0 !important; right: 0 !important;
    width: 100% !important;
  }
  .hero-bg-img img { width: 100% !important; object-fit: cover !important; }

  /* ===== SECTIONS ===== */
  .section {
    padding: 36px 20px !important;
  }

  .section-label {
    font-size: 10px !important;
    letter-spacing: 2px !important;
    margin-bottom: 10px !important;
  }

  .section-title {
    font-size: 24px !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
    margin-bottom: 24px !important;
  }

  /* ===== SERVICES GRID → 1 coluna com cards ===== */
  .services-section {
    padding: 36px 20px !important;
  }

  .services-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .service-card {
    width: 100% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    margin-bottom: 0 !important;
  }

  .service-img {
    width: 100% !important;
    height: 140px !important;
    aspect-ratio: unset !important;
    object-fit: cover !important;
  }

  .service-placeholder {
    height: 140px !important;
    aspect-ratio: unset !important;
  }

  .service-body {
    padding: 18px !important;
  }

  .service-body h3 {
    font-size: 16px !important;
    margin-bottom: 6px !important;
  }

  .service-body p {
    font-size: 12px !important;
    line-height: 1.6 !important;
  }

  /* ===== WHY GRID → 2x2 compacto ===== */
  .why-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    border: 1px solid #e8e0d5 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-top: 24px !important;
  }

  .why-item {
    padding: 20px !important;
    border: 1px solid #e8e0d5 !important;
    border-top: none !important;
    border-left: none !important;
  }

  .why-item:nth-child(1),
  .why-item:nth-child(2) {
    border-top: none !important;
  }

  .why-item:nth-child(odd) {
    border-left: none !important;
  }

  .why-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    margin-bottom: 12px !important;
  }

  .why-item h3 {
    font-size: 13px !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
  }

  .why-item p {
    font-size: 11px !important;
    line-height: 1.6 !important;
  }

  /* ===== ABOUT ===== */
  .about-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
    padding: 36px 20px !important;
  }

  .about-img-block { width: 100% !important; }
  .about-main-img, .about-img-placeholder {
    aspect-ratio: 16/9 !important;
    width: 100% !important;
  }
  .about-badge { right: 0 !important; bottom: 0 !important; }
  .about-content { padding-left: 0 !important; }
  .about-content p { font-size: 14px !important; line-height: 1.75 !important; }

  /* ===== GALLERY ===== */
  .gallery-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    gap: 8px !important;
    margin-top: 20px !important;
  }

  .gallery-item {
    height: 100px !important;
    border-radius: 6px !important;
  }

  .gallery-item:first-child {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
    height: 150px !important;
  }

  /* ===== TESTIMONIALS ===== */
  .testimonials-section { padding: 36px 20px !important; }

  .testimonials-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .testimonial-card {
    padding: 20px !important;
    border-radius: 8px !important;
  }

  /* ===== CTA BAND ===== */
  .cta-band {
    padding: 36px 20px !important;
    text-align: center !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  .cta-band::before { display: none !important; }
  .cta-band-text h2 { font-size: 22px !important; }

  /* ===== FORM ===== */
  .form-section { padding: 36px 20px !important; }
  .form-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* ===== FOOTER ===== */
  footer { padding: 36px 20px 24px !important; }

  .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .footer-brand {
    margin-bottom: 24px !important;
  }

  .footer-cols, .footer-links-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    margin-bottom: 24px !important;
  }

  .footer-col h5, .footer-links h5 {
    font-size: 10px !important;
    letter-spacing: 2px !important;
    margin-bottom: 14px !important;
  }

  .footer-col a, .footer-links a {
    font-size: 12px !important;
    margin-bottom: 10px !important;
    display: block !important;
  }

  .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding-top: 20px !important;
    font-size: 11px !important;
    text-align: center !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* ===== SERVICE PAGES ===== */
  .service-hero {
    padding: 100px 20px 56px !important;
    background-attachment: scroll !important;
    text-align: center !important;
  }

  .service-hero h1 { font-size: clamp(26px, 8vw, 36px) !important; }
  .service-hero p { font-size: 14px !important; }

  .service-hero-cta {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .cta-button {
    width: 100% !important;
    max-width: 320px !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 14px 20px !important;
  }

  .content-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    margin-bottom: 40px !important;
  }

  .content-image {
    width: 100% !important;
    height: 200px !important;
    order: -1 !important;
  }
  .content-image img {
    width: 100% !important; height: 100% !important; object-fit: cover !important;
  }

  .content-text h2 { font-size: 20px !important; }

  .why-choose-section { padding: 36px 20px !important; }

  .why-choose-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .why-item-card {
    padding: 20px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
    text-align: left !important;
  }
  .why-item-icon { margin: 0 !important; flex-shrink: 0 !important; }

  .service-cta { padding: 36px 20px !important; }
  .service-cta h2 { font-size: 22px !important; }
  .service-cta-buttons {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* ===== PORTFOLIO ===== */
  .portfolio-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .portfolio-image { height: 200px !important; }
  .portfolio-filters { gap: 8px !important; flex-wrap: wrap !important; }
  .filter-btn { padding: 8px 14px !important; font-size: 13px !important; }

  /* ===== FAQ ===== */
  .faq-container { margin-top: 20px !important; }
  .faq-question { padding: 18px !important; font-size: 14px !important; }
  .faq-answer-content { padding: 16px 18px !important; font-size: 13px !important; }
}

/* ===== FOOTER COLS FIX (footer-grid 3 cols → brand + 2 service cols) ===== */
@media screen and (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    margin-bottom: 0 !important;
  }

  .footer-brand {
    margin-bottom: 8px !important;
  }

  .footer-desc {
    font-size: 12px !important;
    max-width: 100% !important;
    color: rgba(255,255,255,0.4) !important;
  }

  .footer-col {
    display: block !important;
  }

  /* Coloca as 2 colunas de links lado a lado */
  .footer-grid > .footer-col:nth-child(2),
  .footer-grid > .footer-col:nth-child(3) {
    display: inline-block !important;
    width: 48% !important;
    vertical-align: top !important;
  }

  .footer-grid > .footer-col:nth-child(3) {
    margin-left: 4% !important;
  }

  .footer-col h5 {
    font-size: 10px !important;
    margin-bottom: 14px !important;
  }

  .footer-links {
    gap: 10px !important;
  }

  .footer-links a {
    font-size: 12px !important;
  }

  .footer-contact a {
    font-size: 12px !important;
  }
}
