:root {
      --page-bg: #e8e9e8;
      --text: #111;
      --line: rgba(17,17,17,.18);
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      min-height: 100%;
      background: #000;
    }

    body {
      color: var(--text);
      font-family: "Times New Roman", Times, serif;
      overflow: hidden;
    }

    /* INTRO */
    #intro {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      height: 100dvh;
      z-index: 999999;
      background: #000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      overflow: hidden;
      transition: opacity .58s ease;
    }

    #intro.hide {
      opacity: 0;
      pointer-events: none;
    }

    .intro-inner {
      position: relative;
      width: min(91vw, 760px);
      opacity: 0;
      transform: scale(.965);
      animation:
        logoIn .78s cubic-bezier(.2,.7,.2,1) .10s forwards,
        logoZoom 2.05s ease-in-out .70s forwards;
    }

    .intro-logo {
      width: 100%;
      height: auto;
      display: block;
      user-select: none;
      -webkit-user-drag: none;
    }

    .spark {
      position: absolute;
      width: 7px;
      height: 7px;
      opacity: 0;
      pointer-events: none;
    }

    .spark::before,
    .spark::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background: #fff;
      border-radius: 999px;
      box-shadow:
        0 0 7px rgba(255,255,255,.95),
        0 0 15px rgba(255,255,255,.6);
    }

    .spark::before { width: 1px; height: 18px; }
    .spark::after { width: 18px; height: 1px; }

    .s1 { left: 18%; top: 54%; animation: sparkle .42s ease 1.03s forwards; }
    .s2 { left: 61%; top: 38%; animation: sparkle .42s ease 1.48s forwards; }
    .s3 { left: 83%; top: 58%; animation: sparkle .42s ease 1.92s forwards; }

    @keyframes logoIn {
      to { opacity: 1; transform: scale(1); }
    }

    @keyframes logoZoom {
      to { transform: scale(1.032); }
    }

    @keyframes sparkle {
      0% { opacity: 0; transform: scale(.35) rotate(0deg); }
      40% { opacity: 1; transform: scale(1.1) rotate(12deg); }
      100% { opacity: 0; transform: scale(.15) rotate(28deg); }
    }

    /* CATALOG */
    #catalog {
      display: none;
      min-height: 100vh;
      min-height: 100dvh;
      background: var(--page-bg);
      opacity: 0;
    }

    body.catalog-visible {
      overflow: auto;
      background: var(--page-bg);
    }

    body.catalog-visible #catalog {
      display: block;
      animation: catalogIn .42s ease forwards;
    }

    @keyframes catalogIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    main {
      width: 100%;
      min-height: 100vh;
      min-height: 100dvh;
      padding:
        max(8px, env(safe-area-inset-top))
        14px
        max(24px, env(safe-area-inset-bottom));
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .grid {
      width: 100%;
      max-width: 640px;
      margin: 0 auto;
    }

    .product {
      display: block;
      width: 100%;
      color: inherit;
      text-decoration: none;
      border: 0;
      padding: 0;
      background: transparent;
      font: inherit;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .image-wrap {
      width: 100%;
      min-height: 68vh;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    .product img {
      display: block;
      width: 100%;
      max-height: 73vh;
      object-fit: contain;
      transition: transform 180ms ease;
    }

    .product:active img {
      transform: scale(.985);
    }

    .info {
      padding-top: 8px;
      text-align: center;
    }

    .name {
      margin: 0;
      font-size: clamp(9px, 2.45vw, 12px);
      line-height: 1.25;
      font-weight: 400;
      letter-spacing: .11em;
    }

    .price {
      margin: 5px 0 0;
      font-size: clamp(9px, 2.35vw, 12px);
      line-height: 1.2;
      font-weight: 400;
      letter-spacing: .09em;
    }

    /* FULL-SCREEN DETAIL VIEW */
    #detail {
      position: fixed;
      inset: 0;
      z-index: 9000;
      background: var(--page-bg);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      opacity: 0;
      visibility: hidden;
      transform: translateY(12px);
      transition:
        opacity .28s ease,
        transform .28s ease,
        visibility 0s linear .28s;
    }

    #detail.open {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
      transition:
        opacity .28s ease,
        transform .28s ease;
    }

    .detail-close {
      position: fixed;
      top: max(14px, env(safe-area-inset-top));
      right: 15px;
      z-index: 9100;
      width: 34px;
      height: 34px;
      border: 0;
      background: rgba(232,233,232,.88);
      color: #111;
      font: 300 23px/1 Arial, sans-serif;
      display: grid;
      place-items: center;
      border-radius: 50%;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      backdrop-filter: blur(6px);
    }

    .gallery {
      width: 100%;
      display: flex;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      overscroll-behavior-x: contain;
    }

    .gallery::-webkit-scrollbar {
      display: none;
    }

    .slide {
      flex: 0 0 100%;
      width: 100%;
      min-height: 72vh;
      min-height: 72dvh;
      scroll-snap-align: start;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 18px 14px 8px;
    }

    .slide img {
      display: block;
      width: 100%;
      max-height: 70vh;
      max-height: 70dvh;
      object-fit: contain;
    }

    .slide.detail-photo img {
      width: calc(100% - 16px);
      max-height: 67vh;
      max-height: 67dvh;
      object-fit: cover;
      border-radius: 0;
    }

    .detail-copy {
      width: 100%;
      max-width: 640px;
      margin: 0 auto;
      padding:
        18px
        18px
        max(34px, env(safe-area-inset-bottom));
    }

    .counter {
      margin: 0 0 22px;
      font-size: 9px;
      letter-spacing: .18em;
      text-align: center;
    }

    .detail-title {
      margin: 0;
      font-size: 13px;
      font-weight: 400;
      letter-spacing: .12em;
      text-align: center;
    }

    .detail-price {
      margin: 7px 0 26px;
      font-size: 12px;
      letter-spacing: .10em;
      text-align: center;
    }

    .specs {
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      padding: 12px 0;
      margin-bottom: 22px;
      text-align: center;
    }

    .specs p {
      margin: 0;
      font-size: 9px;
      line-height: 1.8;
      letter-spacing: .17em;
      text-transform: uppercase;
    }


    .size-selector {
      margin: 0 0 18px;
      text-align: center;
    }

    .size-label {
      margin: 0 0 10px;
      font-size: 9px;
      letter-spacing: .18em;
    }

    .sizes {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
    }

    .size-btn {
      appearance: none;
      -webkit-appearance: none;
      border: 0;
      border-right: 1px solid var(--line);
      background: transparent;
      color: #111;
      padding: 13px 0;
      font-family: inherit;
      font-size: 10px;
      letter-spacing: .12em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .size-btn:last-child {
      border-right: 0;
    }

    .size-btn.active {
      background: #111;
      color: #fff;
    }

    .request {
      display: block;
      width: 100%;
      padding: 15px 16px;
      border: 0;
      background: #111;
      color: #fff;
      text-align: center;
      text-decoration: none;
      font-family: inherit;
      font-size: 10px;
      letter-spacing: .18em;
      text-transform: uppercase;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .request-disabled {
      opacity: .34;
      cursor: default;
    }

    .hint {
      margin: 11px 0 0;
      text-align: center;
      font-size: 8px;
      letter-spacing: .13em;
      opacity: .65;
    }

    @media (min-width: 780px) {
      .grid { max-width: 720px; }
      .detail-copy { max-width: 720px; }
      .slide { min-height: 78vh; }
    }

    @media (prefers-reduced-motion: reduce) {
      .intro-inner,
      .spark {
        animation-duration: .01ms !important;
        animation-delay: .01ms !important;
      }
      #detail {
        transition: none;
      }
    }

/* Ajuste exclusivo de la tercera imagen: textura del polerón.
   Mantiene el formato rectangular, pero sube el encuadre para mostrar mejor el tejido. */
.gallery .slide:nth-child(3) img {
  object-position: center 28%;
}
