:root {
  --bg: #f3efe9;
  --paper: #fbf7f0;
  --gold: #ab8450;
  --gold-soft: rgba(171,132,80,.34);
  --text: #3f362f;
  --muted: #7b6b5e;
  --shadow: 0 24px 80px rgba(72,52,31,.14);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 6% 0%, rgba(255,255,255,.95), transparent 30%),
    linear-gradient(135deg, #f4eee6 0%, #fbf8f3 42%, #e8ddcf 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  overflow: hidden;
}

.app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(8px, 1vw, 16px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(128px, 10vw, 176px);
  gap: clamp(8px, 1vw, 16px);
  transform-origin: center center;
}

.viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}

.slide-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 16px 46px rgba(62,43,24,.12);
}

.arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(61,43,25,.13);
  cursor: pointer;
}

.arrow-left { left: 10px; }
.arrow-right { right: 10px; }

.sidebar {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
}

.brand span,
.brand small,
.counter,
.caption {
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand span {
  display: block;
  color: var(--gold);
  font-size: .68rem;
}

.brand strong {
  display: block;
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: .92;
}

.brand small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.5;
}

.controls {
  display: grid;
  gap: 8px;
}

.counter {
  color: var(--muted);
  font-size: .72rem;
}

.controls button {
  width: 100%;
  border: 1px solid var(--gold-soft);
  background: rgba(255,255,255,.64);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 10px;
  cursor: pointer;
}


.contact-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--gold-soft);
  background: rgba(171,132,80,.12);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 10px;
  font-size: .72rem;
  line-height: 1.15;
  word-break: break-word;
}

.contact-link:hover {
  background: rgba(171,132,80,.2);
}

.progress {
  height: 2px;
  background: rgba(171,132,80,.22);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 8.333%;
  height: 100%;
  background: linear-gradient(90deg, #bd9862, #8f6841);
  transition: width .3s ease;
}

.caption {
  margin: 0;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.45;
}

.thumbs {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.thumb {
  flex: 0 0 clamp(76px, 7.2vh, 106px);
  width: 100%;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(255,255,255,.54);
  cursor: pointer;
  overflow: hidden;
}

.thumb.active {
  border-color: var(--gold);
  background: rgba(255,255,255,.94);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: var(--paper);
  border-radius: 9px;
}

/* Celular deitado: layout horizontal normal */
@media (max-width: 940px) and (orientation: landscape) {
  .app {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 6px;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 6px;
    transform: none;
  }

  .viewer {
    border-radius: 16px;
  }

  .brand {
    display: none;
  }

  .sidebar {
    gap: 6px;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .controls button {
    padding: 7px 8px;
    font-size: .72rem;
  }

  .counter,
  .caption {
    font-size: .56rem;
    line-height: 1.25;
  }

  .thumbs {
    gap: 5px;
  }

  .thumb {
    flex-basis: 62px;
    min-height: 62px;
    border-radius: 10px;
  }

  .arrow {
    width: 36px;
    height: 36px;
  }
}

/*
  Celular em pé:
  aqui está o pulo do gato.
  O site é girado por CSS.
  Então, mesmo que o navegador não vire sozinho,
  você vira o aparelho na mão e vê tudo horizontal.
*/
@media (max-width: 820px) and (orientation: portrait) {
  html,
  body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .app {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 100vh;
    height: 100vw;
    padding: 6px;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 6px;
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .viewer {
    border-radius: 16px;
  }

  .brand {
    display: none;
  }

  .sidebar {
    gap: 6px;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .controls button {
    padding: 7px 8px;
    font-size: .72rem;
  }

  .counter,
  .caption {
    font-size: .56rem;
    line-height: 1.25;
  }

  .thumbs {
    gap: 5px;
  }

  .thumb {
    flex-basis: 62px;
    min-height: 62px;
    border-radius: 10px;
  }

  .arrow {
    width: 36px;
    height: 36px;
  }
}

/* Instagram mobile override */
@media (max-width: 940px) {
  .contact-link {
    padding: 7px 8px;
    font-size: .64rem;
  }
}
