/* css/styles.css */

/* ========== Base ========== */
:root{
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, .10);
  --shadow: 0 12px 30px rgba(17, 24, 39, .10);
  --shadow-soft: 0 10px 25px rgba(0,0,0,.12);
  --radius: 18px;
  --radius-sm: 14px;
  --focus: rgba(59, 130, 246, .35);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, #ffffff 0%, var(--bg) 55%, #f3f5fb 100%);
}

img{ max-width: 100%; display: block; }

a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* Focus visível */
:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
  border-radius: 10px;
}

/* ========== Topbar / Header ========== */
.topbar{
  padding: 34px 0 18px;
}

.topbar h1{
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subtitle{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Header da galeria */
.page-header{
  padding: 26px 0 14px;
}

.breadcrumb{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
}

.breadcrumb:hover{
  background: rgba(255,255,255,.95);
}

/* ========== Grid de fábricas (home) ========== */
.grid-3x2{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 18px 0 34px;
}

@media (max-width: 900px){
  .grid-3x2{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .grid-3x2{ grid-template-columns: 1fr; }
}

/* Card da fábrica */
.factory-card{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 170px;
}

.factory-card img{
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  filter: grayscale(1) contrast(1.05) brightness(.98);
  transition: filter .18s ease, transform .18s ease;
}

.factory-card span{
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #1f2937;
  padding: 0 2px 2px;
}

.factory-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(17,24,39,.14);
  background: #fff;
}

.factory-card:hover img{
  filter: grayscale(0) contrast(1.02) brightness(1.02);
  transform: scale(1.015);
}

/* ========== Galeria (thumbs) ========== */
.gallery{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 0 36px;
}

@media (max-width: 900px){
  .gallery{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .gallery{ grid-template-columns: 1fr; }
}

.gallery-item{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(17,24,39,.08);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.gallery-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(17,24,39,.12);
  background: #fff;
}

.gallery-item img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

@media (max-width: 560px){
  .gallery-item img{ height: 260px; }
}

/* ========== Lightbox ========== */
/* Fonte da verdade: classe .is-open (aria-hidden é só acessibilidade) */
.lightbox {
  display: none !important;
}

.lightbox.is-open {
  display: flex !important;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.55);
  z-index: 99999;
}

.lightbox-card{
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18);
}

.lightbox-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(17,24,39,.08);
  background: linear-gradient(#ffffff, #fafbff);
}

.lightbox-titlewrap{
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.lightbox-titlewrap strong{
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.lightbox-counter{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.lightbox-actions{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lightbox-close,
.lightbox-nav{
  border: 1px solid rgba(17,24,39,.12);
  background: #ffffff;
  color: #111827;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  box-shadow: 0 10px 18px rgba(17,24,39,.08);
}

.lightbox-nav{
  width: 40px;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
}

.lightbox-close:hover,
.lightbox-nav:hover{
  background: #f3f4f6;
  transform: translateY(-1px);
}

.lightbox-img{
  width: 100%;
  height: auto;
  display: block;
  max-height: 82vh;
  object-fit: contain;
  background: #0b0f19;
}

/* ========== Footer ========== */
.footer{
  padding: 22px 0 30px;
  color: var(--muted);
  text-align: center;
}

.footer small{
  font-size: 12px;
}

/* WhatsApp: blindado contra CSS global */
.whatsapp-float{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 999px;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  text-decoration: none !important;

  background: #25D366;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
  z-index: 99999;

  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
}

.whatsapp-float:hover{ filter: brightness(1.03); transform: translateY(-2px); }
.whatsapp-float:active{ transform: translateY(0); }

/* impede regras globais de svg/img afetarem */
.whatsapp-float svg{
  width: 28px !important;
  height: 28px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  fill: #fff !important;
  /* micro-ajuste: sobe o ícone 1px para centralizar visualmente */
  transform: translateY(-1px) !important;
}

.whatsapp-float::after{ display:none !important; } /* remove tooltip se estiver “esquisito” */
.whatsapp-float::before{ display:none !important; } /* remove pulse se estiver “esquisito” */

@keyframes waPulse{
  0%   { opacity: .0; transform: scale(.9); }
  20%  { opacity: .35; }
  100% { opacity: 0; transform: scale(1.25); }
}

/* Footer centralizado na mesma largura da grid (container) */
.site-footer{
  margin-top: 32px;
  padding: 32px 0 calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.65);
}

.site-footer .footer-center{
  width: 100%;
  text-align: center !important;
}

.site-footer small{
  display: inline-block;
  font-size: 13px;
  color: rgba(107,114,128,.68); /* mais opaco */
  letter-spacing: .01em;
}

.container { margin-left: auto; margin-right: auto; }

/* ========== Header com logotipo ========== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 9990;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(17,24,39,.08);
}

.site-header-inner{
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center; /* centraliza o logo */
}

/* Logo: trava tamanho e proporção mesmo se existir img{width:100%} */
.site-logo{
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.site-logo img{
  height: 100px !important;     /* ajuste aqui (24–30px) */
  width: auto !important;
  max-width: 400px !important; /* impede logo muito largo
  object-fit: contain;
  display: block;
}

/* Pequenas melhorias de legibilidade */
p{ line-height: 1.45; }