* {
  box-sizing: border-box;
}

:root {
  --bg1: #0e061e;
  --bg2: #0b0214;
  --panel: rgba(30, 23, 55, 0.35);
  --panel2: rgba(30, 23, 55, 0.55);
  --text: #E0E0E0;
  --muted: #A6A6A6;
  --accent: #7C5CFF;
  --accent2: #BFAFFF;
}

html {
  background:
    radial-gradient(circle at 20vw 30vh, rgba(70, 0, 150, 0.2), transparent 40vh),
    radial-gradient(circle at 80vw 80vh, rgba(140, 0, 255, 0.15), transparent 40vh),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  font-family: 'Noto Sans', sans-serif;
  color: var(--text);
  background: transparent;
}


.logo {
  width: calc(1170vh / 55);
  height: calc(620vh / 55);
  margin-top: 2vh;
  margin-left: 2vh;
  position: fixed;
  cursor: pointer;
  /* Mostra il cursore a mano per indicare che è cliccabile */
  display: block;
  transition: transform .2s ease, opacity .2s ease;
}

.logo:hover {
  transform: scale(1.04);
  opacity: .9;
}

/* PAGE LAYOUT */
.page {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 105px 0 60px;
  /* spazio sopra per non coprire con il logo */
}

.product {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

/* LEFT: GALLERY */
.gallery {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
}

/* MAIN IMAGE 4:3 via vh */
.main-frame {
  height: 56vh;
  /* dimensione responsive */
  width: calc(56vh * 4 / 3);
  /* mantiene 4:3 */
  max-width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(30, 23, 55, 0.55);
}

.main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* cambia in cover se vuoi riempire */
  display: block;
}

/* THUMBNAILS 4:3 via vh */
.thumb-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.thumb-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
}

.thumb-img {
  height: 12vh;
  width: calc(12vh * 4 / 3);
  max-height: 110px;
  /* limite su schermi grandi */
  object-fit: cover;
  border-radius: 12px;
  opacity: .65;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
  display: block;
}

.thumb-btn:hover .thumb-img {
  opacity: 1;
  transform: translateY(-2px);
}

.thumb-btn.is-active .thumb-img {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.9);
}

/* RIGHT: DETAILS */
.details {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
}

.title {
  margin: 0 0 10px 0;
  font-size: 32px;
  color: #fff;
}

.price {
  margin: 0 0 8px 0;
  font-size: 26px;
  color: var(--accent2);
}

.shipping {
  margin: 0 0 18px 0;
  color: var(--muted);
}

.buy {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: var(--accent);
  color: white;
  font-size: 17px;
  font-weight: 700;
  transition: transform .15s ease, filter .15s ease;
}

.buy:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.block {
  margin-top: 22px;
}

.block h3 {
  margin: 0 0 10px 0;
  color: var(--accent2);
  font-size: 18px;
}

.block p,
.block li {
  color: var(--text);
  opacity: .92;
  line-height: 1.5;
}

.block ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 768px) {

  /* blocca qualsiasi sforamento orizzontale */
  html, body { overflow-x: hidden; }

  /* Logo absolute centrato */
  body{ position: relative; }

  .logo{
    position: absolute;
    top: 14px;
    left: 49.5%;
    transform: translateX(-50%);
    width: min(62vw, 220px);
    height: auto;
    margin: 0;
    z-index: 999;
  }

  /* Page: niente numeri strani, centrata davvero */
  .page{
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 92px 16px 44px;   /* 16px di “safe padding” ai lati */
    padding-bottom: 10vh;
  }

  /* FLEX IN COLONNA */
  .product{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Blocchi centrati e larghi uguali */
  .gallery,
  .details{
    width: 100%;
    margin: 0;
    padding: 14px;
    border-radius: 16px;
  }

  .gallery{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5vh;
  }

  /* Immagine principale: 4:3 senza calcoli in vh (evita shift) */
  .main-frame{
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(30, 23, 55, 0.55);
  }

  .main-img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  /* Thumbnails: riga scrollabile, non sposta nulla */
  .thumb-row{
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: nowrap;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    padding: 10px 2px 2px;
  }

  .thumb-row::-webkit-scrollbar{ display:none; }

  .thumb-btn{ flex: 0 0 auto; }

  .thumb-img{
    width: clamp(86px, 30vw, 140px);
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
  }

  /* Testi */
  .title{ font-size: 26px; }
  .price{ font-size: 22px; }
  .block h3{ font-size: 17px; }

  /* Bottone più comodo */
  .buy{
    height: 54px;
    border-radius: 16px;
    font-size: 16px;
  }
}
