/* ============================================================================
 * iShop · comun/css/reset.css
 * ----------------------------------------------------------------------------
 * Normalización ESTRUCTURAL. Sin una sola opinión estética.
 *
 * Prohibido añadir aquí nada que se pueda ver: ni font-family, ni color, ni
 * line-height, ni font-size. Todo eso vive en css/01-tokens.css, que es el
 * único sitio donde se decide el aspecto del producto.
 *
 * Todo lo que puede colisionar va en :where() → especificidad 0, de modo que
 * el CSS de la interfaz nunca tenga que pelear con el reset.
 * ========================================================================== */

@layer reset {

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -moz-tab-size: 2;
    tab-size: 2;
  }

  body {
    min-block-size: 100svb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Los reemplazados como bloque: elimina el hueco de la línea base. */
  :where(img, svg, video, canvas, audio, iframe, embed, object) {
    display: block;
  }

  :where(img, svg, video) {
    max-inline-size: 100%;
    block-size: auto;
  }

  /* Los controles no heredan tipografía por defecto. Aquí sí. */
  :where(input, button, textarea, select) {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }

  :where(button) {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: inherit;
  }

  :where(textarea) {
    resize: vertical;
  }

  /* Solo las listas marcadas como tales pierden su viñeta: quitarla de todas
     las <ul> rompe el anuncio de "lista de N elementos" en VoiceOver. */
  :where(ul, ol)[role='list'] {
    list-style: none;
    padding: 0;
  }

  :where(table) {
    border-collapse: collapse;
    border-spacing: 0;
  }

  :where(th) {
    text-align: start;
    font-weight: inherit;
  }

  :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, fieldset) {
    margin: 0;
  }

  :where(fieldset) {
    border: 0;
    padding: 0;
    min-inline-size: 0;
  }

  :where(a) {
    color: inherit;
  }

  /* El ancla saltada no queda pegada al borde superior del viewport. */
  :where(:target) {
    scroll-margin-block-start: 6ch;
  }

  /* Sin esto, un <dialog> hereda el fondo blanco del agente de usuario. */
  :where(dialog) {
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    max-inline-size: none;
    max-block-size: none;
  }

  :where([hidden]) {
    display: none !important;
  }

  /* NO font-family. NO color. NO background. NO line-height. NO font-size. */
}
