/* ============================================
   SEÇÃO HARDWARE — Showcase estilo Square
   55 Site v7 · Componente section-hardware
   Produtos grandes em destaque, hover swap base⇄working
   ============================================ */

.vp-hardware {
  position: relative;
  background: var(--linho);
  padding: clamp(72px, 10vh, 130px) 0;
  overflow: clip;
  --hw-h: clamp(360px, 40vw, 560px);
}

/* Cabeçalho — texto à esquerda, setas à direita */
.vp-hardware-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto clamp(40px, 5vw, 64px);
  padding: 0 clamp(24px, 6vw, 100px);
}

.vp-hardware-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 620px;
}

.vp-hardware .section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ouro);
  margin: 0;
}

.vp-hardware-title {
  font-family: 'Bodoni Moda', serif;
  font-weight: 400;
  font-size: var(--fs-h2);
  color: var(--noite);
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  margin: 0;
}
.vp-hardware-title em {
  font-style: italic;
  color: var(--ouro);
}

.vp-hardware-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--noite);
  opacity: 0.72;
  line-height: 1.65;
  margin: 0;
}

/* Setas de navegação — estilo Square */
.hardware-arrows {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.hw-arrow {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(23, 16, 8, 0.2);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--noite);
  padding: 0;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.hw-arrow:hover:not(:disabled) {
  background: var(--noite);
  color: var(--linho);
  border-color: var(--noite);
}
.hw-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Carrossel horizontal */
.hardware-carousel-wrapper {
  position: relative;
  width: 100%;
}
.hardware-cards {
  display: flex;
  gap: clamp(20px, 2.5vw, 40px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 clamp(24px, 6vw, 100px) 8px;
  scroll-padding-left: clamp(24px, 6vw, 100px);
}
.hardware-cards::-webkit-scrollbar { display: none; }

/* Card — produto grande, ganhando proporção na viewport */
.hw-card {
  position: relative;
  flex: 0 0 calc(var(--hw-h) * 1.25);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  cursor: default;
}

/* Stage do produto — base + working empilhados para hover swap */
.hw-card-media {
  position: relative;
  width: 100%;
  height: var(--hw-h);
  background: linear-gradient(160deg, #FEFCF7 0%, #F2E8D4 100%);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(23, 16, 8, 0.07);
  transition: box-shadow 0.4s ease;
}
.hw-card:hover .hw-card-media {
  box-shadow: 0 22px 64px rgba(23, 16, 8, 0.13);
}

/* Esmaecido escuro — só no card expandido (hover); topo alpha 0 = sem borda */
.hw-card-media::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 65%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: linear-gradient(to top,
    rgba(20, 14, 8, 0.66) 0%,
    rgba(20, 14, 8, 0.34) 34%,
    rgba(20, 14, 8, 0.12) 60%,
    rgba(20, 14, 8, 0) 100%);
}

.hw-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.45s ease;
  image-rendering: high-quality;
  image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hw-img-working { opacity: 0; }
.hw-card:hover .hw-img-base { opacity: 0; }
.hw-card:hover .hw-img-working { opacity: 1; }
/* KioskMini working é foto lifestyle quadrada (1:1); cover preenche a
   caixa landscape e elimina as faixas do gradiente nas laterais */
.hw-card[data-produto="kioskmini"] .hw-img-working { object-fit: cover; }

/* Texto — overlay sobre a imagem no desktop/tablet, abaixo dela no mobile */
.hw-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 72px 32px 28px;
  border-radius: 0;
}
.hw-card-titulo {
  font-family: 'Bodoni Moda', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  color: var(--noite);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}
.hw-card-frase {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  color: var(--noite);
  opacity: 0.55;
  margin: 0;
  max-width: 440px;
}

/* Reveal do subtexto + esmaecido no hover — desktop/tablet com mouse (estilo Square) */
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
  /* Em repouso só o título aparece; a frase entra no hover */
  .hw-card-body {
    display: grid;
    grid-template-rows: auto 0fr;
    transition: grid-template-rows 0.3s ease 0.08s;
  }
  .hw-card-frase {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease 0.08s, transform 0.3s ease 0.08s;
  }
  .hw-card-titulo {
    transition: color 0.35s ease;
  }
  .hw-card:hover .hw-card-body {
    grid-template-rows: auto 1fr;
  }
  .hw-card:hover .hw-card-media::after {
    opacity: 1;
  }
  .hw-card:hover .hw-card-titulo {
    color: var(--linho);
  }
  .hw-card:hover .hw-card-frase {
    opacity: 1;
    transform: translateY(0);
    color: rgba(255, 255, 255, 0.82);
  }
}

/* Elementos exclusivos do carrossel mobile — ocultos no desktop/tablet */
.hw-card-topbar,
.hw-dots,
.hw-swipe-hint {
  display: none;
}

/* Responsivo */
@media (max-width: 1024px) {
  .vp-hardware-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  /* Section — header como bloco próprio, carrossel full-viewport */
  .vp-hardware { padding: 0; }

  /* Header centralizado */
  .vp-hardware-head {
    display: block;
    max-width: none;
    margin: 0;
    padding: 80px 24px 40px;
    text-align: center;
  }
  .vp-hardware-text {
    max-width: none;
    gap: 0;
    align-items: center;
  }
  .vp-hardware .section-label {
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--cedro);
  }
  .vp-hardware-title {
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    line-height: 1;
    margin: 16px auto 0;
  }
  .vp-hardware-title em { color: var(--ouro-acessivel); }
  .vp-hardware-desc {
    font-size: 16px;
    line-height: 1.55;
    max-width: 320px;
    margin: 24px auto 0;
    color: var(--noite);
    opacity: 0.75;
  }
  .hardware-arrows { display: none; }

  /* Carrossel — cada slide ocupa 1 viewport */
  .hardware-carousel-wrapper {
    width: 100vw;
    height: 100svh;
  }
  .hardware-cards {
    width: 100vw;
    height: 100svh;
    gap: 0;
    padding: 0;
    scroll-padding-left: 0;
  }
  .hw-card {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    grid-template-rows: 40px 1fr auto;
    /* sem padding lateral: a mídia full-bleed (inset:0) precisa preencher
       100vw exatos — o respiro lateral fica no topbar e no body */
    padding: 32px 0 64px;
    box-sizing: border-box;
  }
  .hw-card[data-produto="kioskmini"]  { background: var(--profundo); }
  .hw-card[data-produto="stand55"]    { background: var(--linho); }
  .hw-card[data-produto="terminal55"] { background: var(--noite); }

  /* Fileira 1 — topbar do slide */
  .hw-card-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 24px;
  }
  .hw-card-counter {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--linho);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
  .hw-card-swipe {
    display: inline-flex;
    color: var(--linho);
    opacity: 0.6;
    animation: hwSwipeNudge 2s ease-in-out infinite;
  }

  /* Fileira 2 — mídia full-bleed: a foto lifestyle preenche o slide */
  .hw-card-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    background: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    display: block;
  }
  .hw-img-working {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: none;
  }
  /* imagem de produto tem fundo branco — não entra no mobile */
  .hw-img-base { display: none; }
  /* scrim escuro sobre a foto — mais forte embaixo, garante leitura do texto */
  .hw-card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    height: auto;
    z-index: 1;
    opacity: 1;
    pointer-events: none;
    background: linear-gradient(to bottom,
      rgba(20, 14, 8, 0.20) 0%,
      rgba(20, 14, 8, 0.44) 46%,
      rgba(20, 14, 8, 0.92) 100%);
  }

  /* Fileira 3 — texto no rodapé do slide, acima da mídia */
  .hw-card-body {
    position: relative;
    z-index: 1;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 24px;
    background: none;
    border-radius: 0;
    text-align: center;
  }
  .hw-card-titulo {
    font-size: clamp(2.2rem, 9vw, 3rem);
    line-height: 0.95;
    margin: 0 0 12px;
    color: var(--linho);
  }
  .hw-card-frase {
    font-size: 15px;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
    opacity: 0.85;
    color: var(--linho);
  }

  /* Indicador de progresso */
  .hw-dots {
    display: flex;
    gap: 8px;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
  }
  .hw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cedro);
    opacity: 0.3;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
  }
  .hw-dot.is-active {
    background: var(--ouro);
    opacity: 1;
    transform: scale(1.4);
  }

  /* Hint de swipe — primeira interação */
  .hw-swipe-hint {
    display: block;
    position: absolute;
    right: 28px;
    bottom: 76px;
    z-index: 6;
    color: var(--cedro);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  .hw-swipe-hint.is-visible {
    opacity: 0.5;
    animation: hwHintSwipe 1.5s ease-in-out infinite;
  }
}

@keyframes hwSwipeNudge {
  0%, 100% { transform: translateX(-3px); }
  50%      { transform: translateX(3px); }
}
@keyframes hwHintSwipe {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-40px); }
}

/* Acessibilidade — movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .hw-img,
  .hw-card-media,
  .hw-card-media::after,
  .hw-card-body,
  .hw-card-titulo,
  .hw-card-frase {
    transition: none !important;
  }
  .hw-card-swipe,
  .hw-swipe-hint,
  .hw-dot {
    animation: none !important;
    transition: none !important;
  }
}
