/**
 * Laboratório de Ideias 3D — vitrine premium (camada sobre o tema existente).
 * Escopo: html.lab3d-vitrine
 */

html.lab3d-vitrine {
  scroll-behavior: smooth;
  /* Paleta da logo Laboratório de Ideias 3D */
  --lab3d-blue-light: #50c8ef;
  --lab3d-blue-deep: #2d60b3;
  --lab3d-yellow: #fff200;
  --lab3d-orange: #f7941d;
  --lab3d-lime: #8dc63f;
  --lab3d-magenta: #ec008c;
  --lab3d-red: #ed1c24;
}

html.lab3d-vitrine body {
  font-family: 'Outfit', 'Poppins', system-ui, sans-serif;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(80, 200, 239, 0.16), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(236, 0, 140, 0.07), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(141, 198, 63, 0.09), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 38%, #f1f5f9 100%) !important;
  color: #0f172a !important;
  --surface-body: transparent;
  --surface-card: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(241, 245, 249, 0.9);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(45, 96, 179, 0.22);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --card-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --card-shadow-hover: 0 18px 44px rgba(80, 200, 239, 0.14);
}

/* Wireframe ambience - grid 3D sutil */
.lab3d-wire-grid {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: 
    linear-gradient(rgba(80, 200, 239, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 200, 239, 0.15) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  animation: lab3dGridDrift 120s linear infinite;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}

@keyframes lab3dGridDrift {
  to {
    transform: translate3d(-52px, -52px, 0);
  }
}

/* Hero */
.lab3d-hero {
  position: relative;
  min-height: 100svh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 28px
    max(16px, env(safe-area-inset-left));
  margin-bottom: 4px;
  box-sizing: border-box;
}

.lab3d-hero-cap {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: saturate(1.05) brightness(1.05);
}

.lab3d-hero-grad {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 40% 15%, rgba(80, 200, 239, 0.18), transparent 52%),
    radial-gradient(circle at 88% 35%, rgba(247, 148, 29, 0.1), transparent 48%),
    radial-gradient(circle at 20% 80%, rgba(236, 0, 140, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(248, 250, 252, 0.92) 55%, rgba(241, 245, 249, 0.98) 100%);
  pointer-events: none;
}

.lab3d-hero-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 3px,
    rgba(15, 23, 42, 0.018) 3px,
    rgba(15, 23, 42, 0.018) 6px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.lab3d-float-cube {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(80, 200, 239, 0.2), rgba(255, 242, 0, 0.08), rgba(247, 148, 29, 0.06));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 32px rgba(45, 96, 179, 0.06), inset 0 0 20px rgba(255, 255, 255, 0.35);
  animation: lab3dFloat 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.lab3d-float-cube.c1 {
  top: 14%;
  right: 8%;
  transform: rotate(15deg) scale(1);
  animation-delay: -2s;
}

.lab3d-float-cube.c2 {
  bottom: 20%;
  left: 6%;
  width: 70px;
  height: 70px;
  animation-duration: 10s;
  opacity: 0.7;
  transform: rotate(-10deg);
}

@keyframes lab3dFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-18px) rotate(8deg); }
}

.lab3d-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(920px, 100%);
  margin-inline: auto;
  text-align: center;
  padding-top: clamp(12px, 4vh, 40px);
  padding-inline: clamp(4px, 2vw, 12px);
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 20px);
}

.lab3d-eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--lab3d-blue-deep);
  font-weight: 600;
}

.lab3d-hero-inner h2 {
  font-family: 'Syne', 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(1.65rem, 5.2vw, 2.85rem);
  line-height: 1.14;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: manual;
  max-width: 100%;
  margin-inline: auto;
  padding-inline: clamp(8px, 3vw, 24px);
  background: linear-gradient(
    125deg,
    var(--lab3d-blue-deep) 0%,
    var(--lab3d-blue-light) 38%,
    var(--lab3d-orange) 78%,
    var(--lab3d-magenta) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* fallback quando clip não aplicar bem */
  -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
  .lab3d-hero-inner h2 {
    color: var(--lab3d-blue-deep);
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  .lab3d-rotate-text {
    color: var(--lab3d-orange);
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  html.lab3d-vitrine .category.active .category-name {
    color: var(--lab3d-blue-deep) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
  }
}

.lab3d-hero-sub {
  max-width: 36rem;
  margin-inline: auto;
  font-size: clamp(0.94rem, 2.9vw, 1.06rem);
  line-height: 1.55;
  color: var(--text-secondary);
}

.lab3d-rotate-text {
  min-height: 1.6em;
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 28rem;
  margin-inline: auto;
  transition: opacity 0.35s ease;
  background: linear-gradient(92deg, var(--lab3d-blue-deep) 10%, var(--lab3d-lime) 45%, var(--lab3d-orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lab3d-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.lab3d-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
}

.lab3d-btn-primary {
  color: #152339;
  background: linear-gradient(135deg, var(--lab3d-blue-light) 0%, var(--lab3d-yellow) 48%, var(--lab3d-orange) 100%);
  box-shadow: 0 10px 28px rgba(80, 200, 239, 0.32);
}

.lab3d-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 40px rgba(247, 148, 29, 0.28);
}

.lab3d-btn-ghost {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.lab3d-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(80, 200, 239, 0.45);
}

/* Logo mark */
.lab3d-logo-shell {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 32px;
  padding: 3px;
  background: linear-gradient(135deg, var(--lab3d-blue-light), var(--lab3d-yellow) 42%, var(--lab3d-magenta) 100%);
  box-shadow: 0 16px 40px rgba(45, 96, 179, 0.12), 0 0 32px rgba(80, 200, 239, 0.22);
}

.lab3d-logo-shell-inner {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.lab3d-logo-shell-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lab3d-logo-shell:hover .lab3d-logo-shell-inner img {
  transform: scale(1.06) rotate(2deg);
}

/* Below-hero toolbar */
.lab3d-top-tools {
  position: relative;
  z-index: 3;
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: auto;
}

.lab3d-top-tools .social {
  grid-column: 1 / -1;
}

.lab3d-glass-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 12px;
  margin: 4px 0 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.lab3d-hero-chip-prod {
  gap: 10px;
  cursor: pointer;
  background: rgba(248, 250, 252, 0.95) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

html.lab3d-vitrine .status {
  margin: 28px auto 14px !important;
}

html.lab3d-vitrine .status.aberto span {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.28)) !important;
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #14532d !important;
}

html.lab3d-vitrine .location,
html.lab3d-vitrine .horarios-info {
  color: var(--text-secondary) !important;
}

html.lab3d-vitrine .categories-wrapper {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  padding: 8px 0 10px;
}

html.lab3d-vitrine .category {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

html.lab3d-vitrine .category .category-name {
  color: #0f172a;
  font-weight: 700;
}

/* Sobrescreve o tema base (.category.active { color: white }) no fundo claro */
html.lab3d-vitrine .category.active {
  background: linear-gradient(155deg, rgba(80, 200, 239, 0.16), rgba(255, 242, 0, 0.12), rgba(255, 255, 255, 0.99)) !important;
  color: #1e293b !important;
  border: 2px solid rgba(80, 200, 239, 0.5) !important;
  box-shadow: 0 6px 22px rgba(45, 96, 179, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(247, 148, 29, 0.18) !important;
}

html.lab3d-vitrine .category.active .category-name {
  display: inline-block;
  width: 100%;
  font-weight: 800;
  line-height: 1.35;
  background: linear-gradient(
    118deg,
    var(--lab3d-blue-deep) 0%,
    var(--lab3d-blue-light) 32%,
    var(--lab3d-orange) 72%,
    var(--lab3d-magenta) 110%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

/* Product cards vitrine */
html.lab3d-vitrine .accordion-item {
  border-radius: 20px !important;
  margin-bottom: 14px !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: var(--card-shadow);
}

html.lab3d-vitrine .accordion-header {
  background: linear-gradient(90deg, rgba(80, 200, 239, 0.14), rgba(255, 255, 255, 0)) !important;
  color: var(--text-primary) !important;
}

html.lab3d-vitrine .product-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 22px !important;
  backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s,
    box-shadow 0.35s;
}

html.lab3d-vitrine .product-card h4,
html.lab3d-vitrine .product-card .description {
  color: var(--text-primary) !important;
}

@media (hover: hover) {
  html.lab3d-vitrine .product-card:hover {
    transform: translateY(-5px) rotateX(2deg);
    border-color: rgba(80, 200, 239, 0.42) !important;
    box-shadow: var(--card-shadow-hover);
  }
}

html.lab3d-vitrine .product-card img {
  border-radius: 14px !important;
}

html.lab3d-vitrine .product-card .price {
  font-weight: 700;
}

/* Bottom sheet modal produto */
#produto-modal .produto-modal-content {
  border-radius: 28px 28px 0 0 !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 -24px 50px rgba(15, 23, 42, 0.12);
}

.lab3d-prod-gallery-main {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  margin-bottom: 12px;
}

.lab3d-prod-gallery-main img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: contain;
}

.lab3d-prod-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.lab3d-prod-gallery-thumbs button {
  flex: 0 0 62px;
  height: 62px;
  border-radius: 12px;
  border: 2px solid transparent;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #e2e8f0;
}

.lab3d-prod-gallery-thumbs button.is-active {
  border-color: rgba(247, 148, 29, 0.9);
}

.lab3d-spec-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.lab3d-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.lab3d-chip i {
  color: var(--lab3d-blue-deep);
}

.lab3d-video-btn {
  margin: 6px 0 14px;
  width: 100%;
  border-radius: 14px;
  padding: 12px;
  font-weight: 700;
  border: 1px solid rgba(236, 0, 140, 0.38);
  background: rgba(236, 0, 140, 0.06);
  color: var(--lab3d-magenta);
  cursor: pointer;
}

.lab3d-pers-block {
  margin: 14px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 252, 240, 0.75);
  border: 1px dashed rgba(80, 200, 239, 0.4);
}

.lab3d-pers-block label {
  display: block;
  font-weight: 600;
  margin: 10px 0 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.lab3d-pers-block input,
.lab3d-pers-block textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: var(--text-primary);
}

/* Checkout região */
.lab3d-regiao-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.lab3d-regiao-opt {
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: border-color 0.2s, background 0.2s;
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--surface-card);
}

.lab3d-regiao-opt.is-on {
  border-color: rgba(80, 200, 239, 0.55);
  background: rgba(80, 200, 239, 0.08);
}

/* Floating orçamento - lado esquerdo para não conflitar com carrinho */
.lab3d-fab-orcamento {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 9990;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--lab3d-yellow) 0%, var(--lab3d-orange) 45%, var(--lab3d-magenta) 100%);
  box-shadow: 0 8px 24px rgba(45, 96, 179, 0.18), 0 4px 12px rgba(236, 0, 140, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.lab3d-fab-orcamento:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(45, 96, 179, 0.25), 0 6px 16px rgba(236, 0, 140, 0.15);
}

@media (min-width: 900px) {
  .lab3d-fab-orcamento {
    bottom: 28px;
    left: 28px;
  }
}

/* Modal orçamento */
#lab3d-modal-orcamento.lab3d-orc-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 10050;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(8px);
  padding: 12px;
}

#lab3d-modal-orcamento.lab3d-orc-mask.is-open {
  display: flex;
}

.lab3d-orc-panel {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  padding: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.lab3d-orc-panel h3 {
  font-family: 'Syne', sans-serif;
  margin-bottom: 12px;
  color: #0f172a;
}

footer {
  background: transparent !important;
  color: var(--text-muted) !important;
}

/* Desktop: coluna central confortável (evita “esticado” em telas largas) */
@media (min-width: 900px) {
  .lab3d-hero {
    justify-content: center;
    min-height: min(90vh, 880px);
    padding-bottom: 40px;
  }

  .lab3d-hero-inner {
    max-width: 680px;
    padding-top: clamp(28px, 5vh, 48px);
  }

  .lab3d-hero-inner h2 {
    font-size: clamp(2.15rem, 3vw, 2.85rem);
  }

  html.lab3d-vitrine .status,
  html.lab3d-vitrine .horarios-info,
  html.lab3d-vitrine .social,
  html.lab3d-vitrine .location {
    max-width: 1100px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(16px, 3vw, 32px);
    padding-right: clamp(16px, 3vw, 32px);
    box-sizing: border-box;
  }

  html.lab3d-vitrine .categories-wrapper {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(8px, 2vw, 24px);
    padding-right: clamp(8px, 2vw, 24px);
    box-sizing: border-box;
    border-radius: 0 0 14px 14px;
  }

  html.lab3d-vitrine #promocoes-section {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(16px, 3vw, 32px);
    padding-right: clamp(16px, 3vw, 32px);
    box-sizing: border-box;
  }

  html.lab3d-vitrine .accordion {
    max-width: 1100px;
    margin: 15px auto !important;
    padding-left: clamp(12px, 2.5vw, 28px);
    padding-right: clamp(12px, 2.5vw, 28px);
    box-sizing: border-box;
  }

  html.lab3d-vitrine .social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 599px) {
  .lab3d-hero {
    /* evita headline “presa” por altura fixa quando há bottom nav / safe areas */
    min-height: unset;
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }

  .lab3d-float-cube.c1 {
    width: 72px;
    height: 72px;
    opacity: 0.55;
  }

  .lab3d-float-cube.c2 {
    width: 56px;
    height: 56px;
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab3d-wire-grid,
  .lab3d-float-cube,
  .lab3d-logo-shell-inner img {
    animation: none !important;
  }
}
