/* Ajustes finales para que la tienda se vea como fortnite.com/item-shop (medidas tomadas de esa página).
   Se carga al final para ganar a las capas anteriores sin tocarlas. */

/* Barra lateral (escritorio): botón de filtro 48×48 blanco translúcido y riel negro translúcido de 48 px,
   filas de 28 px y puntos de 8 px (12 px el activo), como fortnite.com. Solo el riel colapsado;
   el riel expandido al pasar el mouse no cambia. Desde 1440 px la barra muestra los nombres de las
   secciones (como Fortnite en pantalla grande), así que ahí no se toca. */
@media (1024px <= width < 1440px) {
  html:root[data-lotso-preview] body.storefront-page #giftView#giftView .section-sidebar:not(.is-compact) #filterToggle {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
    /* Sin desenfoque de fondo (es caro al hacer scroll); un poco más opaco para verse igual. */
    background: rgba(255, 255, 255, .88) !important;
    color: #151718 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html:root[data-lotso-preview] body.storefront-page #giftView#giftView .section-sidebar:not(.is-compact):not(:has(> :where(.sidebar-block):is(:hover, :focus-within))) .sidebar-block:not(#lotso-none) {
    width: 48px !important;
    padding: 12px 0 !important;
    border-radius: 20px !important;
    background: rgba(0, 0, 0, .74) !important;
    /* Mismo desenfoque ligero que tenía antes; 32 px como Fortnite hacía pesado el scroll. */
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
  }
  html:root[data-lotso-preview] body.storefront-page #giftView#giftView .section-sidebar:not(.is-compact):not(:has(> :where(.sidebar-block):is(:hover, :focus-within))) .sidebar-block #sectionNav {
    --rail-available: min(400px, calc(100dvh - 190px));
    --rail-row: 28px;
  }
  html:root[data-lotso-preview] body.storefront-page #giftView#giftView .section-sidebar:not(.is-compact):not(:has(> :where(.sidebar-block):is(:hover, :focus-within))) .sidebar-block #sectionNav > a::before {
    left: 50% !important;
    top: 50% !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: #fff !important;
    opacity: .5 !important;
    transform: translate(-50%, -50%) !important;
  }
  html:root[data-lotso-preview] body.storefront-page #giftView#giftView .section-sidebar:not(.is-compact):not(:has(> :where(.sidebar-block):is(:hover, :focus-within))) .sidebar-block #sectionNav > a.is-active::before {
    width: 12px !important;
    height: 12px !important;
    opacity: 1 !important;
  }
}

/* Flechas del carrusel: cuadro blanco translúcido de 40×40, esquinas de 12 px y flecha más gruesa,
   montadas sobre el borde de las tarjetas como en Fortnite. */
html:root body.storefront-page #giftView .section-scroll-button {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  /* Sin desenfoque de fondo: hay decenas de flechas en la página y cada una lo recalculaba al hacer scroll. */
  background: rgba(255, 255, 255, .88) !important;
  color: #151718 !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html:root body.storefront-page #giftView .section-scroll-button svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 4 !important;
}

/* Precio tachado: al lado del precio (como Fortnite) cuando hay espacio; solo si la tarjeta es angosta
   se queda encima. Se decide por el ancho real del bloque de precios. */
html:root body.storefront-page #giftView#giftView #shopGrid .item-card .prices {
  container: lotso-price / inline-size;
}
@container lotso-price (inline-size >= 230px) {
  html:root body.storefront-page #giftView#giftView #shopGrid .item-card .price-track .vbucks:has(.original-vbucks) {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 8px !important;
  }
  html:root body.storefront-page #giftView#giftView #shopGrid .item-card .price-track .vbucks > .original-vbucks {
    align-self: baseline !important;
    transform: none !important;
    font-size: 14px !important;
    opacity: .7;
  }
}

@media (width >= 640px) {
  html:root body.storefront-page #giftView .shop-section.is-carousel > .section-scroll-button.is-left { left: -18px !important; }
  html:root body.storefront-page #giftView .shop-section.is-carousel > .section-scroll-button.is-right { right: -18px !important; }

  /* El aro de la tarjeta seleccionada (y el leve zoom al pasar el mouse) necesitan ~7 px de aire a los lados.
     Relleno de 10 px compensado con margen y ancho para que las tarjetas no se muevan; el recorte de 3 px
     deja ver el aro pero oculta el borde de la tarjeta siguiente (empieza 8-9 px después). */
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section.is-carousel > .section-grid {
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin-left: -2px !important;
    margin-right: -2px !important;
    scroll-padding-inline: 10px !important;
    width: calc(100% + 4px) !important;
    max-width: none !important;
    clip-path: inset(0 3px) !important;
  }

  /* Secciones en cuadrícula: 14 px del título a las tarjetas y 17 px entre filas, como fortnite.com. */
  html:root body.storefront-page #giftView #shopGrid .shop-section:not(.is-carousel) > .section-grid {
    padding-top: 34px !important;
    row-gap: 17px !important;
  }

  /* Canciones: portada con esquinas de 16 px; artista con la misma fuente de los títulos (16 px)
     y título de la canción un poco más grande (19 px), como en Fortnite. */
  html:root body.storefront-page #giftView #shopGrid .shop-section .item-card.is-jam-track {
    --track-caption-room: 101px;
  }
  html:root body.storefront-page #giftView #shopGrid .shop-section .item-card.is-jam-track:has(.original-price) {
    --track-caption-room: 114px;
  }
  /* Las canciones usaban todo el alto de la tarjeta como fondo y quedaban ~15% más altas que el resto.
     Ahora dejan el mismo espacio libre arriba que las demás y la portada queda dentro del fondo,
     con aire hasta la etiqueta, como en Fortnite. */
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section .item-card.is-jam-track {
    --shop-art-headroom: 15%;
    background: transparent !important;
  }
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section .item-card.is-jam-track::before {
    content: "";
    position: absolute;
    inset: var(--shop-art-headroom) 0 0;
    border-radius: 20px;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--tile-color) 88%, white 12%), var(--tile-color) 66%, #080808);
    pointer-events: none;
  }
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section .item-card.is-jam-track::after {
    top: calc(var(--shop-art-headroom) - 5px) !important;
  }
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section .item-card.is-jam-track .expires {
    inset-block-start: calc(var(--shop-art-headroom) + 8px) !important;
  }
  /* Portada como en fortnite.com: centrada, 87.5% del ancho, asomando sobre el fondo (8% del alto),
     esquinas de 6 px, borde blanco tenue y sombra. Al pasar el mouse sube a 3.3% y se inclina −2°. */
  html:root body.storefront-page #giftView#giftView#giftView #shopGrid .shop-section .item-card.is-jam-track .item-art > .card-render {
    left: 50% !important;
    top: 35.5% !important;
    width: 87.5% !important;
    height: auto !important;
    max-width: none !important;
    aspect-ratio: 1 !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 6px !important;
    outline: 2px solid rgba(255, 255, 255, .16) !important;
    outline-offset: -2px !important;
    /* box-shadow en vez de filter: mismo resultado en una portada cuadrada, mucho más liviano. */
    filter: none !important;
    box-shadow: 0 0 3px #000 !important;
    /* Solo se anima transform (no top) para no recalcular el diseño en cada cuadro. */
    transition: transform .2s ease-in-out !important;
  }
  /* Subir del 8% al 3.3% del alto de la tarjeta = 8.6% del alto de la portada. */
  html:root body.storefront-page #giftView#giftView#giftView #shopGrid .shop-section .item-card.is-jam-track:is(:hover, :focus-within) .item-art > .card-render {
    transform: translate(-50%, -58.6%) rotate(-2deg) !important;
  }
  html:root body.storefront-page #giftView #shopGrid .shop-section .item-card.is-jam-track .item-type {
    font-family: "Golos Text", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    line-height: 1.15 !important;
  }
  html:root body.storefront-page #giftView #shopGrid .shop-section .item-card.is-jam-track h4 {
    font-size: 19px !important;
  }
}

/* Desde 1440 px la sección mide 955 px. Tras el borde del contenido se deja ver solo 7 px (lo que ocupa el aro
   de 5 px), igual que a la izquierda y que en los demás anchos. Antes eran 13 px y, en la penúltima página, la
   tarjeta siguiente (a 9 px) asomaba 4 px (Úrsida en Ofertas del día, Widowmaker en Lo más vendido).
   Va al final para ganar a la regla general del carrusel (misma especificidad). */
@media (width >= 1440px) {
  html:root body.storefront-page #giftView#giftView #shopGrid .shop-section.is-carousel > .section-grid {
    padding-right: 15px !important;
    margin-right: -9px !important;
    width: calc(100% + 11px) !important;
    clip-path: inset(0 8px 0 3px) !important;
  }
}

/* Pantalla angosta: la barra superior fija ya muestra el código de creador (creator-code-compact);
   el botón grande sobre «Lo más vendido» lo repetía. Se oculta solo mientras esa barra está activa. */
html:root body.storefront-page #giftView .shop-layout:has(> .section-sidebar.is-compact .creator-code-compact) .creator-banner {
  display: none !important;
}
