/* =========================================
   AD PAGE - marketplace clean (Viva-like)
========================================= */

/* ✅ impede "estourar largura" no mobile quando tem muitas thumbs */
html, body{
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== Alertas / breadcrumbs ===== */
.ok-banner{
  margin: 12px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(16,185,129,.25);
  background: rgba(16,185,129,.10);
  font-weight: 900;
}

.crumbs{
  margin: 10px 0 12px;
  color: rgba(12,14,20,0.70);
  font-weight: 800;
  font-size: 13px;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
}
.crumbs a{ color: rgba(47,107,255,1); }
.crumbs .sep{ opacity:.6; }

/* ===== Layout ===== */
.ad-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

/* ✅ importantíssimo: evita que a coluna "force" largura por causa dos thumbs */
.gallery{ min-width: 0; }

/* ===== Cards (leves) ===== */
.gallery,
.ad-card,
.ad-desc{
  background: #fff;
  border: 1px solid rgba(20,30,55,0.12);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

/* ===== Galeria ===== */
.gallery{
  padding: 14px;
}

/* Container controla o tamanho (PC) */
.main-photo{
  position: relative;
  width: 100%;
  height: 420px;
  max-height: 420px;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(20,30,55,0.10);

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ imagem nunca estoura */
.main-photo img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: opacity .14s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.no-photo{
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 950;
  color: rgba(12,14,20,0.72);
  background: linear-gradient(135deg, rgba(47,107,255,0.10), rgba(0,0,0,0.04));
}

/* Setas + contador */
.gal-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.30);
  background: rgba(0,0,0,0.32);
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: transform .18s ease, background .18s ease;
}
.gal-nav:hover{
  transform: translateY(-50%) scale(1.05);
  background: rgba(0,0,0,0.40);
}
.gal-prev{ left: 10px; }
.gal-next{ right: 10px; }

.gal-count{
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.40);
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.22);
  font-weight: 950;
  font-size: 12px;
}

/* ✅ THUMBS: nunca quebram layout, só scroll horizontal */
.thumbs{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.thumbs::-webkit-scrollbar{
  height: 8px;
}
.thumbs::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,0.12);
  border-radius: 999px;
}

.thumb{
  border: 1px solid rgba(20,30,55,0.12);
  background: #fff;
  border-radius: 10px;
  padding: 0;
  width: 78px;
  height: 58px;
  overflow: hidden;
  cursor: pointer;

  flex: 0 0 auto; /* ✅ garante que cada thumb não encolhe nem estica */
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.is-active{
  border-color: rgba(47,107,255,0.55);
  box-shadow: 0 8px 16px rgba(47,107,255,0.14);
}

/* ===== Card lateral ===== */
.ad-card{
  padding: 14px;
  position: sticky;
  top: 88px;
}

.tag{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid rgba(47,107,255,.22);
  background: rgba(47,107,255,.08);
  color: rgba(29,78,216,1);
}

.ad-card h1{
  margin-top: 10px;
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.meta{
  margin-top: 8px;
  color: rgba(12,14,20,0.70);
  font-weight: 800;
  font-size: 13px;
}

.price-row{
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price{
  font-weight: 950;
  font-size: 16px;
}

.small{
  color: rgba(12,14,20,0.62);
  font-weight: 800;
  font-size: 12px;
}

.btn-email{
  background: rgba(47,107,255,0.10);
  border: 1px solid rgba(47,107,255,0.25);
  color: rgba(29,78,216,1);
}
.btn-email:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(47,107,255,0.16);
}

.contact-note{
  margin-top: 8px;
  color: rgba(12,14,20,0.62);
  font-weight: 850;
  font-size: 12px;
}

.contact-off{
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(20,30,55,0.12);
  background: #fff;
  font-weight: 850;
}

.report{
  margin-top: 12px;
  width: 100%;
  border: 1px dashed rgba(220,38,38,0.45);
  background: rgba(220,38,38,0.06);
  color: rgba(185,28,28,1);
  border-radius: 12px;
  padding: 10px;
  font-weight: 950;
  cursor: pointer;
}

/* ===== Descrição (✅ alinhada e com largura 100%) ===== */
.ad-desc{
  grid-column: 1 / -1;
  padding: 14px;
  max-width: 100%;    /* ✅ antes era 860px e podia dar sensação "longe" */
  margin-top: 14px;
}

.ad-desc h2{
  font-size: 15px;
  margin: 0 0 8px 0;  /* ✅ remove qualquer deslocamento estranho */
  font-weight: 950;
}

.desc-text{
  white-space: pre-wrap;
  color: rgba(12,14,20,0.86);
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== Modal denúncia ===== */
.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9999;
}
.modal.is-open{ display:block; }
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
}
.modal-card{
  position:relative;
  z-index:1;
  max-width:560px;
  margin:10vh auto 0;
  background:#fff;
  border-radius:12px;
  padding:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}

/* ===== Responsivo ===== */
@media (max-width: 980px){
  .ad-grid{ grid-template-columns: 1fr; }
  .ad-card{ position: relative; top: 0; }
}

/* ✅ mobile: limita vitrine pra não ficar "gigante" */
@media (max-width: 768px){
  .main-photo{
    height: 62vh;
    max-height: 62vh;
  }
  .main-photo img{
    max-height: 62vh;
  }
}
