/*
 * Menu «Productos» (quimegafitxa 1.3.0). Colors de Quimega: vermell #d8001d.
 */
.quimega-menu {
  position: static;
}

.quimega-menu__simbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.quimega-menu__boto {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #d8001d;
  color: #fff;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.quimega-menu__boto:hover,
.quimega-menu__boto[aria-expanded="true"] {
  background: #a80016;
}

.quimega-menu__hamb {
  width: 16px;
  height: 12px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.quimega-menu__hamb i {
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ---------- ordinador ---------- */
@media (min-width: 768px) {
  .quimega-menu {
    position: relative;
  }

  .quimega-menu__panell {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 1050;
    width: min(1000px, calc(100vw - 2rem));
    min-height: 460px;
    display: grid;
    grid-template-columns: 300px 1fr;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 0.75rem;
    box-shadow: 0 18px 40px rgba(20, 25, 35, 0.16);
    overflow: hidden;
  }

  .quimega-menu__panell[hidden] {
    display: none;
  }

  .quimega-menu__mobil-cap {
    display: none;
  }

  .quimega-menu__blocs {
    grid-column: 1;
    grid-row: 1 / span 2;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: #fbfbfc;
    border-right: 1px solid #e3e6ea;
  }

  .quimega-menu__sub {
    grid-column: 2;
    grid-row: 1;
    display: none;
    padding: 1.25rem 1.6rem;
  }

  .quimega-menu__sub.is-actiu {
    display: block;
  }

  .quimega-menu__subs {
    columns: 2;
    column-gap: 2rem;
  }

  .quimega-menu__peu {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }
}

.quimega-menu__bloc {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: #1f2328;
  font-weight: 500;
  text-decoration: none;
}

.quimega-menu__bloc:hover,
.quimega-menu__bloc.is-actiu {
  background: #fdecee;
  color: #d8001d;
}

.quimega-menu__ico {
  width: 22px;
  height: 22px;
  flex: none;
  color: #d8001d;
}

.quimega-menu__fl {
  margin-left: auto;
  color: #b0b6bd;
}

.quimega-menu__bloc.is-actiu .quimega-menu__fl {
  color: #d8001d;
}

.quimega-menu__sub-cap {
  margin-bottom: 0.75rem;
}

.quimega-menu__sub-titol {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2328;
  text-decoration: none;
}

.quimega-menu__veure {
  font-size: 0.85rem;
  color: #d8001d;
}

.quimega-menu__subs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quimega-menu__subs li {
  break-inside: avoid;
}

.quimega-menu__subs a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #edf0f2;
  color: #1f2328;
  text-decoration: none;
}

.quimega-menu__subs a:hover {
  color: #d8001d;
}

.quimega-menu__subs small {
  color: #5f6670;
}

.quimega-menu__marques {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: #5f6670;
}

.quimega-menu__marques b {
  color: #1f2328;
}

.quimega-menu__peu {
  display: flex;
  gap: 1.5rem;
  padding: 0.8rem 1.6rem;
  border-top: 1px solid #f0f2f4;
  font-size: 0.85rem;
}

.quimega-menu__peu a {
  color: #5f6670;
}

/* ---------- capçalera: cercador ample al costat del botó (ordinador) ---------- */
@media (min-width: 768px) {
  .header-bottom #_desktop_ps_searchbar {
    flex: 1 1 auto;
    max-width: 620px;
    margin-left: 1rem !important;
  }

  .header-bottom #_desktop_ps_searchbar .ps-searchbar,
  .header-bottom #_desktop_ps_searchbar form,
  .header-bottom #_desktop_ps_searchbar input {
    width: 100%;
  }

  .header-bottom #_desktop_ps_searchbar input {
    border-color: #cfd4da;
  }

  .header-bottom #_desktop_ps_searchbar input:focus {
    border-color: #d8001d;
    box-shadow: 0 0 0 0.2rem rgba(216, 0, 29, 0.15);
  }

  .quimega-enllacos {
    order: 3;
    gap: 1.25rem;
    margin-left: auto;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .quimega-enllacos a {
    color: #5f6670;
    text-decoration: none;
  }

  .quimega-enllacos a:hover {
    color: #d8001d;
  }
}

/* ---------- portada: targetes dels blocs ---------- */
.quimega-portada {
  margin: 1.5rem 0 2.5rem;
}

.quimega-portada__titol {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.quimega-portada__graella {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .quimega-portada__graella {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .quimega-portada__graella {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.quimega-portada__bloc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 0.6rem;
  color: #1f2328;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quimega-portada__bloc:hover {
  border-color: #d8001d;
  box-shadow: 0 6px 18px rgba(20, 25, 35, 0.08);
  color: #1f2328;
}

.quimega-portada__ico {
  width: 28px;
  height: 28px;
  color: #d8001d;
}

.quimega-portada__bloc b {
  font-size: 0.95rem;
}

.quimega-portada__bloc span {
  color: #5f6670;
  font-size: 0.8rem;
}

/* Text de presentació de la portada com a targeta (esbós) */
#index .ps-customtext > .container {
  background: linear-gradient(110deg, #fff 0%, #fff 55%, #fdecee 100%);
  border: 1px solid #e3e6ea;
  border-radius: 0.75rem;
  padding: 1.75rem 2rem;
  margin-top: 1.5rem;
}

/* ---------- mòbil: llista per nivells a pantalla completa ---------- */
@media (max-width: 767.98px) {
  .quimega-menu__boto-text {
    display: none;
  }

  .quimega-menu__boto {
    padding: 0.6rem 0.7rem;
  }

  .quimega-menu__panell {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: #fff;
    overflow-y: auto;
  }

  .quimega-menu__panell[hidden] {
    display: none;
  }

  .quimega-menu__mobil-cap {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
    font-weight: 600;
  }

  .quimega-menu__tancar {
    margin-left: auto;
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
  }

  .quimega-menu__enrere {
    border: 0;
    background: none;
    color: #d8001d;
    font-weight: 600;
    padding: 0;
  }

  .quimega-menu__blocs {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .quimega-menu__bloc {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f2f4;
  }

  .quimega-menu__bloc.is-actiu {
    background: none;
    color: #1f2328;
  }

  .quimega-menu__sub {
    display: none;
    padding: 0 1rem 1rem;
  }

  .quimega-menu__sub-titol {
    display: none;
  }

  .quimega-menu__veure {
    display: block;
    padding: 0.85rem 0;
    font-weight: 600;
    border-bottom: 1px solid #f0f2f4;
  }

  .quimega-menu__subs a {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f2f4;
  }

  /* Nivell 2: es veu un sol bloc i s'amaga la llista de blocs */
  .quimega-menu__panell.is-nivell2 .quimega-menu__blocs {
    display: none;
  }

  .quimega-menu__panell.is-nivell2 .quimega-menu__sub.is-actiu {
    display: block;
  }

  .quimega-menu__peu {
    padding: 1rem;
  }
}
