:root {
  /* PALETA AREBUSCÁ */
  --black: #252321;
  --white: #F7F2E8;
  --cream: #EFE5D4;
  --wood: #D8C0A0;
  --wood-dark: #B79A76;
  --brown: #70553D;
  --taupe: #9A8B78;
  --grey: #756C62;
  --line: #CBB99F;
  --soft: #E8DCC9;

  --header-height: 76px;
}


/* =========================================================
   GENERAL
   ========================================================= */

.products-page {
  width: 100%;
  padding-top: var(--header-height);
}


/* =========================================================
   INTRODUCCIÓN
   ========================================================= */

.products-intro {
  padding: 110px 32px 70px;
  text-align: center;
}

.products-intro .eyebrow {
  margin: 0 0 18px;

  color: var(--brown);

  font-size: 10px;
  font-weight: 400;

  letter-spacing: 2.4px;

  text-transform: uppercase;
}

.products-intro h1 {
  margin: 0;

  color: var(--brown);

  font-size: clamp(48px, 7vw, 90px);

  font-weight: 300;

  letter-spacing: -4px;

  line-height: .95;
}

.products-description {
  max-width: 440px;

  margin: 28px auto 0;

  color: var(--grey);

  font-size: 13px;
  font-weight: 400;

  line-height: 1.7;
}


/* =========================================================
   BÚSQUEDA
   ========================================================= */

.products-search {
  width: calc(100% - 64px);

  max-width: 900px;

  margin: 0 auto 55px;
}

.products-search label {
  display: block;

  margin-bottom: 12px;

  color: var(--grey);

  font-size: 9px;
  font-weight: 400;

  letter-spacing: 1.8px;

  text-transform: uppercase;
}

.search-input-container {
  position: relative;

  width: 100%;
}

.search-input-container input {
  width: 100%;

  height: 52px;

  padding: 0 45px 0 0;

  border: 0;

  border-bottom: 1px solid var(--line);

  outline: none;

  background: transparent;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 14px;
  font-weight: 400;

  transition: border-color 200ms ease;
}

.search-input-container input::placeholder {
  color: var(--grey);

  opacity: .55;
}

.search-input-container input:focus {
  border-bottom-color: var(--brown);
}


/* LIMPIAR BÚSQUEDA */

#clear-search {
  position: absolute;

  top: 50%;
  right: 0;

  width: 32px;
  height: 32px;

  padding: 0;

  display: grid;
  place-items: center;

  transform: translateY(-50%);

  border: 0;

  background: transparent;

  color: var(--grey);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 22px;
  font-weight: 300;

  line-height: 1;

  cursor: pointer;

  opacity: 0;

  pointer-events: none;

  transition:
    opacity 180ms ease,
    color 180ms ease;
}

#clear-search.visible {
  opacity: 1;

  pointer-events: auto;
}

#clear-search:hover {
  color: var(--black);
}


/* =========================================================
   CONTROLES
   ========================================================= */

.products-controls {
  margin: 0 32px;

  padding: 18px 0;

  display: grid;

  grid-template-columns: 1fr auto 1fr;

  align-items: center;

  border-top: 1px solid var(--line);

  border-bottom: 1px solid var(--line);
}


/* FILTRAR */

.filter-button {
  justify-self: start;

  padding: 0;

  display: flex;

  align-items: center;

  gap: 10px;

  border: 0;

  background: transparent;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 10px;
  font-weight: 400;

  letter-spacing: 1.5px;

  text-transform: uppercase;

  cursor: pointer;
}

.filter-button span {
  display: inline-block;

  font-size: 15px;
  font-weight: 300;

  transition: transform 200ms ease;
}

.filter-button:hover span,
.filter-button.active span {
  transform: rotate(45deg);
}


/* CONTADOR */

.products-count {
  color: var(--grey);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 10px;
  font-weight: 400;

  letter-spacing: 1px;

  text-transform: uppercase;
}


/* ORDENAR */

.sort-container {
  justify-self: end;

  display: flex;

  align-items: center;

  gap: 12px;

  color: var(--grey);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 9px;
  font-weight: 400;

  letter-spacing: 1.3px;

  text-transform: uppercase;
}

.sort-container select {
  min-width: 130px;

  padding: 5px 0;

  border: 0;

  outline: none;

  background: transparent;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 10px;
  font-weight: 400;

  cursor: pointer;
}


/* =========================================================
   FILTROS
   ========================================================= */

.filters {
  max-height: 0;

  overflow: hidden;

  margin: 0 32px;

  transition:
    max-height 500ms ease,
    padding 500ms ease;
}


/* ABIERTO */

.filters.open {
  max-height: 800px;

  padding: 32px 0;

  border-bottom: 1px solid var(--line);
}


/* GRUPO */

.filter-group {
  display: flex;

  flex-wrap: wrap;

  align-items: center;

  gap: 8px;

  margin-bottom: 28px;
}

.filter-group:last-child {
  margin-bottom: 0;
}


/* TÍTULO DEL FILTRO */

.filter-group p {
  width: 100%;

  margin: 0 0 7px;

  color: var(--grey);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 9px;
  font-weight: 400;

  letter-spacing: 1.5px;

  text-transform: uppercase;
}


/* OPCIONES */

.filter-option {
  padding: 8px 14px;

  border: 1px solid var(--line);

  background: transparent;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 9px;
  font-weight: 400;

  letter-spacing: 1px;

  cursor: pointer;

  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.filter-option:hover,
.filter-option.active {
  border-color: var(--brown);

  background: var(--brown);

  color: var(--white);
}


/* =========================================================
   GRID DE PRODUCTOS
   ========================================================= */

.products-grid {
  width: 100%;

  padding: 30px 22px 120px;

  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  column-gap: 10px;

  row-gap: 42px;
}


/* =========================================================
   TARJETA
   ========================================================= */

.product-card {
  width: 100%;

  min-width: 0;

  display: block;

  margin: 0;

  padding: 0;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-weight: 400;

  cursor: pointer;
}


/* ENLACE */

.product-link {
  display: block;

  width: 100%;

  margin: 0;

  padding: 0;

  color: inherit;

  text-decoration: none;
}


/* =========================================================
   IMAGEN
   ========================================================= */

.product-image {
  position: relative;

  width: 100%;

  aspect-ratio: 3 / 4;

  overflow: hidden;

  background: var(--cream);
}

.product-image img {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;

  font-family: Arial, Helvetica, sans-serif;

  font-size: 10px;

  font-weight: 400;

  transition:
    transform 600ms cubic-bezier(.22, 1, .36, 1);
}

.product-card:hover .product-image img {
  transform: scale(1.025);
}


/* =========================================================
   PLACEHOLDER
   ========================================================= */

.product-placeholder {
  width: 100%;

  height: 100%;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--cream);

  color: var(--taupe);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 10px;

  font-weight: 400;

  letter-spacing: 1.5px;

  text-transform: uppercase;
}


/* =========================================================
   BADGE
   ========================================================= */

.product-badge {
  position: absolute;

  top: 14px;

  left: 14px;

  z-index: 2;

  padding: 7px 9px;

  background: var(--white);

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 8px;

  font-weight: 400;

  letter-spacing: 1px;

  text-transform: uppercase;
}


/* =========================================================
   INFORMACIÓN DEL PRODUCTO
   ========================================================= */

/*
   IMPORTANTE:
   El productos.js que estamos utilizando actualmente
   genera:

   <div class="product-info">
       <h2>Nombre</h2>
       <p>Precio</p>
   </div>

   Por eso estilizamos h2 y p directamente.
*/

.product-info {
  width: 100%;

  margin: 0;

  padding: 12px 2px 0;

  display: flex;

  flex-direction: row;

  justify-content: space-between;

  align-items: flex-start;

  gap: 12px;
}


/* NOMBRE */

.product-info h2 {
  flex: 1 1 auto;

  min-width: 0;

  margin: 0;

  padding: 0;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 11px;

  font-weight: 400;

  line-height: 1.3;

  letter-spacing: .4px;

  text-transform: uppercase;
}


/* PRECIO */

.product-info p {
  flex: 0 0 auto;

  margin: 0;

  padding: 0;

  color: var(--black);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 11px;

  font-weight: 400;

  line-height: 1.3;

  letter-spacing: 0;

  white-space: nowrap;
}


/* =========================================================
   SIN PRODUCTOS
   ========================================================= */

.no-products {
  padding: 100px 24px 160px;

  text-align: center;
}

.no-products p {
  margin: 0;

  color: var(--grey);

  font-family: Arial, Helvetica, sans-serif;

  font-size: 13px;

  font-weight: 400;

  line-height: 1.6;
}

.favorite-button {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    z-index: 10;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
    border-color: var(--brown);
}


.favorite-button:hover {
    transform: scale(1.08);
}


.favorite-button.is-favorite {
    font-weight: 700;
    color: var(--brown)
}


.favorite-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-color: var(--brown);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

  .products-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    row-gap: 35px;
  }

}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 600px) {

  /* INTRO */

  .products-intro {
    padding: 80px 24px 60px;
  }

  .products-intro h1 {
    font-size: clamp(44px, 14vw, 65px);

    letter-spacing: -3px;
  }

  .products-description {
    max-width: 330px;

    margin-top: 22px;

    font-size: 12px;
  }


  /* BÚSQUEDA */

  .products-search {
    width: calc(100% - 36px);

    margin: 0 auto 40px;
  }

  .products-search label {
    font-size: 8px;
  }

  .search-input-container input {
    height: 48px;

    font-size: 13px;
  }


  /* CONTROLES */

  .products-controls {
    margin: 0 18px;

    padding: 16px 0;

    grid-template-columns:
      1fr auto;
  }

  .products-count {
    display: none;
  }

  .sort-container {
    gap: 7px;
  }

  .sort-container > span {
    display: none;
  }

  .sort-container select {
    min-width: 110px;

    font-size: 9px;
  }


  /* FILTROS */

  .filters {
    margin: 0 18px;
  }

  .filters.open {
    padding: 24px 0;

    max-height: 1000px;
  }

  .filter-group {
    gap: 7px;

    margin-bottom: 24px;
  }

  .filter-group p {
    margin-bottom: 6px;

    font-size: 8px;
  }

  .filter-option {
    padding: 8px 11px;

    font-size: 8px;
  }


  /* GRID */

  .products-grid {
    padding: 20px 10px 80px;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    column-gap: 6px;

    row-gap: 32px;
  }


  /* IMAGEN */

  .product-image {
    aspect-ratio: 3 / 4;
  }


  /* INFORMACIÓN */

  .product-info {
    padding: 9px 1px 0;

    gap: 7px;
  }

  .product-info h2 {
    font-size: 10px;

    font-weight: 400;

    line-height: 1.25;

    letter-spacing: .3px;
  }

  .product-info p {
    font-size: 10px;

    font-weight: 400;

    line-height: 1.25;

    white-space: nowrap;
  }


  /* BADGE */

  .product-badge {
    top: 9px;

    left: 9px;

    padding: 6px 7px;

    font-size: 7px;
  }

  .favorite-button {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    z-index: 10;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
    border-color: var(--brown);
}


.favorite-button:hover {
    transform: scale(1.08);
}


.favorite-button.is-favorite {
    font-weight: 700;
    color: var(--brown)
}


.favorite-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

}


/* =========================================================
   MÓVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 380px) {

  .products-grid {
    padding-left: 8px;

    padding-right: 8px;

    column-gap: 5px;

    row-gap: 28px;
  }

  .product-info {
    padding-top: 8px;

    gap: 5px;
  }

  .product-info h2 {
    font-size: 9px;

    letter-spacing: .25px;
  }

  .product-info p {
    font-size: 9px;
  }

}

.product-card-image-wrapper {
    position: relative;
}


.favorite-button {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    z-index: 10;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
    border-color: var(--brown);
}


.favorite-button:hover {
    transform: scale(1.08);
}


.favorite-button.is-favorite {
    font-weight: 700;
    color: var(--brown)
}


.favorite-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-color: var(--brown);
}