/* ===== Conteiner e Grid ===== */
.product-detail { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 420px; /* evita overflow do 1º bloco */
  gap: 24px;
}

/* Itens da grid não podem forçar largura */
.detail-grid > * { min-width: 0; }

/* Empilha no mobile */
@media (max-width: 900px){
  .detail-grid { grid-template-columns: minmax(0,1fr); }
  .summary { order: 2; }      /* opcional */
  .gallery { order: 1; }
}

/* ===== Galeria ===== */
.gallery { min-width: 0; }     /* permite encolher dentro da grid */
.gallery-main { width: 100%; border-radius: 12px; overflow: hidden; }
#pdMainImg { width: 100%; height: auto; display: block; }

/* Thumbs não devem criar largura horizontal infinita */
.thumbs-row { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.thumbs-track { display: flex; gap: 8px; min-width: 0; }
.thumbs-track img { flex: 0 0 auto; }

/* ===== Form/inputs não estouram ===== */
.summary select,
.summary input[type="number"],
.summary .pd-actions .btn,
.summary .pd-field { max-width: 100%; }

/* ===== Imagens e SVGs em geral ===== */
img, svg, video { max-width: 100%; height: auto; }

/* ===== Safeguard: nunca permita rolagem horizontal ===== */
html, body { overflow-x: hidden; }


.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}
.gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.gallery-main {
  position: relative;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 340px;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.main-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.main-nav.left {
  left: 8px;
}
.main-nav.right {
  right: 8px;
}
.thumbs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  clear: both;
}
.thumb-nav {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.thumbs-track {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 0 2px 4px;
}
.thumbs-track::-webkit-scrollbar {
  height: 8px;
}
.thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.thumb.active {
  border-color: #111827;
}
.gallery {
  margin-bottom: 6px;
}
@media (max-width: 980px) {
  .gallery-main {
    height: 260px;
  }
  .thumb {
    width: 72px;
    height: 72px;
  }
}
.summary {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.06);
  position: sticky;
  top: 20px;
}
.pd-title {
  margin: 0 0 6px;
}
.pd-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pd-price {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 10px 0;
}
.pd-price-sub {
  color: #374151;
  font-size: 0.95rem;
  margin-top: -8px;
  margin-bottom: 8px;
}
.pd-micro {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 0.9rem;
  margin: 6px 0;
}
.pd-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pd-field {
  display: block;
  margin: 8px 0;
}

.pd-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.pd-qty input {
  width: 70px;
  text-align: center;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
.qty-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}
.btn.wpp {
  border-color: #25d366;
  color: #25d366;
}
.pay-methods {
  margin-top: 12px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 10px;
  display: grid;
  gap: 8px;
}
.pay-methods .icons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pm {
  display: inline-grid;
  place-items: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.8rem;
  color: #111827;
}
.installments {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inst-help {
  font-size: 0.9rem;
  color: #374151;
}
.rel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.rel-card {
  display: block;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.rel-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.rel-title {
  padding: 8px 10px;
  font-size: 0.95rem;
  line-height: 1.3;
  min-height: 46px;
}
.rel-price {
  padding: 0 10px 10px;
  font-weight: 600;
}
.room-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-btn {
  min-width: 56px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  padding: 0 10px;
  font-weight: 600;
}
.room-btn[aria-selected="true"],
.room-btn.active {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .summary {
    position: static;
    top: auto;
    padding: 16px;
    margin-top: 12px;
    box-shadow: none;
  }

  .summary .pd-actions {
    flex-direction: column;
    gap: 10px;
  }

  .summary .pd-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .summary .pd-actions .btn + .btn {
    margin-top: 0;
  }

  .summary .pd-field > select,
  .summary .pd-field select,
  .summary .pd-field input[type="number"],
  .summary .pd-field input[type="text"],
  .summary .pd-field input[type="email"] {
    width: 100%;
    max-width: 100%;
  }

  .summary .adult-control {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .summary .adult-control label,
  .summary .adult-control input[type="number"] {
    width: 100%;
  }

  .summary .pd-field > div {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .summary .pd-field label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .summary .pd-field select,
  .summary .pd-field input[type="number"],
  .summary .pd-field input[type="text"],
  .summary .pd-field input[type="email"] {
    width: 100% !important;
  }

  .summary .adult-control {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
  }

  .summary .adult-control button {
    width: 100%;
    height: 42px;
  }

  .summary .adult-control label {
    grid-column: 1 / -1;
    width: 100%;
  }
}
.flash.info {
  background: #ebf5ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 10px;
  border-radius: 8px;
}
.breadcrumb {
  margin-bottom: 8px;
}
.chip.small {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #111827;
}
.divider-h {
  border-top: 1px dashed #e5e7eb;
}

/* ===== Lightbox mínimo (namespaced) ===== */
.gf-lightbox{
  position:fixed; inset:0; display:none;
  align-items:center; justify-content:center;
  background:rgba(0,0,0,.92); z-index:100000;
}
.gf-lightbox.open{ display:flex; }
.gf-lb-img{
  max-width:90vw; max-height:90vh;
  border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.6);
}
.gf-lb-btn{
  position:absolute; border:0; cursor:pointer;
  width:44px; height:44px; border-radius:50%;
  background:rgba(0,0,0,.5); color:#fff; font-size:28px;
  display:grid; place-items:center;
}
.gf-lb-btn:hover{ background:rgba(255,255,255,.25); }
.gf-close{ top:16px; right:18px; font-size:26px; }
.gf-prev{  left:20px; top:50%; transform:translateY(-50%); }
.gf-next{  right:20px; top:50%; transform:translateY(-50%); }
.gf-lb-count{
  position:absolute; bottom:16px; left:50%; transform:translateX(-50%);
  color:#ddd; font-size:14px; background:rgba(0,0,0,.45); padding:4px 8px; border-radius:8px;
}


/* ====== Melhorias de responsividade e acessibilidade ====== */

/* Container com respiro em telas pequenas */
.product-detail {
  padding: clamp(8px, 3vw, 16px);
}

/* Galeria com altura fluida; prevalece sobre altura fixa acima */
.gallery-main {
  height: clamp(240px, 54vw, 420px);
}

/* Thumbs com snap e rolagem suave (respeita reduced-motion) */
.thumbs-track {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.thumb { scroll-snap-align: start; }

@media (prefers-reduced-motion: reduce) {
  .thumbs-track { scroll-behavior: auto; }
}

/* Alvos de toque maiores no mobile */
@media (max-width: 480px) {
  .main-nav { width: 44px; height: 44px; }
  .thumb { width: 64px; height: 64px; }
  .gallery-main { height: clamp(200px, 60vw, 300px); }
}

/* Estados de foco visíveis para navegação por teclado */
.main-nav:focus-visible,
.thumb:focus-visible,
.qty-btn:focus-visible,
.room-btn:focus-visible,
.summary .pd-actions .btn:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

/* Feedback de interação e estados */
.qty-btn:hover, .room-btn:hover { background:#f9fafb; }
.qty-btn:active, .room-btn:active { transform: translateY(1px); }
.qty-btn:disabled, .room-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.summary .pd-actions .btn:hover { filter: brightness(0.98); }
.summary .pd-actions .btn:active { transform: translateY(1px); }
.summary .pd-actions .btn:disabled { opacity: .6; cursor: not-allowed; }

/* Inputs 100% em mobile e tipografia consistente */
.summary .pd-field label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #111;
}

.summary .pd-field input[type="number"],
.summary .pd-field input[type="text"],
.summary .pd-field input[type="email"],
.summary .pd-field input[type="tel"],
.summary .pd-field input[type="date"],
.summary .pd-field select {
  width: 100%;
  max-width: 100%;
}

/* Remove spinners do number quando possível para simplificar UI */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Secção de confiança mais organizada */
.pd-trust { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 768px) {
  .pd-trust { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Breadcrumb com melhor espaçamento clicável */
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ====== Utilitários para remover CSS inline dos parciais ====== */
/* Labels de seção dentro de campos do resumo */
.summary .pd-field .label {
  margin-bottom: 6px;
  font-weight: 600;
}

/* Linha de controles (adultos/crianças) */
.adult-control { display: flex; gap: 8px; align-items: center; }
.pd-inline-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

/* Inputs numéricos compactos (contadores) */
.count-input { width: 90px; }

/* Margens superiores nos blocos dinâmicos de participantes */
#adultParticipantsFields,
#childrenParticipantsFields,
#childrenUnder5Fields { margin-top: 12px; }

/* Avisos específicos */
#earlyCheckinWarning { margin-top: 12px; display: none; }
#roomWarn { display: none; margin-top: 6px; }

/* Divider com espaçamento padrão */
.divider-h { border-top: 1px dashed #e5e7eb; margin: 16px 0; }

/* Larguras mínimas (templates alternativos) */
#compTipo { min-width: 180px; }
#compCap  { min-width: 120px; }
#compDay  { min-width: 220px; }
#buyerName, #buyerEmail { min-width: 200px; }
#buyerPhone, #buyerBirthDate { width: 150px; }





  /* QUADRO FIXO DA FOTO */
  #pdGallery .gallery-main{
    position: relative;
    width: 100%;
    height: 720px;                 /* altura fixa (ajuste) */
    background: #000;              /* bordas pretas (letterbox) */
    border-radius: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;              /* mantém tudo dentro do quadro */
  }

  /* IMAGEM: usa toda a ALTURA, sem distorcer; se sobrar largura, aparecem as bordas pretas */
  #pdGallery .gallery-main > img#pdMainImg{
    max-height: 100%;
    max-width: 100%;
    width: auto;                   /* prioridade: altura */
    height: auto;
    object-fit: contain !important;/* garante que nunca corte nem estique */
    object-position: center center;
    display: block;
  }

  


