@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap");

/* =====================================================================
   TEMA "PEDIAL A CASA" — fill de classic (PrestaShop 8)
   1. Base i tipografia   2. Capçalera   3. Menú   4. Peu i newsletter
   5. Portada (.pedial-home)
   No es toquen preus, botons de compra/carret, etiquetes de producte
   ni fitxes de producte.
   ===================================================================== */

:root {
  --pedial-primary: #cf2d26;
  --pedial-primary-dark: #a82320;
  --pedial-secondary: #1d345f;
  --pedial-black: #1a181b;
  --pedial-sky: #b8e1ff;
  --pedial-cream: #fff0dd;
  --pedial-cream-dark: #f5dfbb;
  --pedial-footer-text: #dfe5f0;
}

/* ---------- 1. Base i tipografia */
body,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.btn, input, select, textarea {
  font-family: "Sora", "Noto Sans", Arial, sans-serif;
}
body { color: var(--pedial-black); }
a { color: var(--pedial-secondary); }
a:hover, a:focus { color: var(--pedial-primary); }

/* Amplada de pàgina: classic es queda a 1140px; en pantalles grans
   n'aprofitem més (com fan els supermercats online) */
@media (min-width: 1400px) {
  .container { width: 1320px; max-width: 100%; }
}
@media (min-width: 1700px) {
  .container { width: 1440px; }
}

/* ---------- 2. Capçalera */
#header { background: var(--pedial-cream); box-shadow: none; }

/* Barra superior vermella (escriptori) */
#header .header-nav {
  background: var(--pedial-primary);
  border-bottom: 0;
  max-height: none;
  margin-bottom: 0;
  color: #fff;
}
#header .header-nav #contact-link,
#header .header-nav #contact-link a,
#header .header-nav .user-info a,
#header .header-nav .user-info .material-icons,
#header .header-nav .blockcart,
#header .header-nav .blockcart a,
#header .header-nav .blockcart .header,
#header .header-nav .blockcart .material-icons {
  color: #fff !important;
}
/* Barra superior (escriptori): telèfon + 2 avantatges amb icona, i a la
   dreta compte + carret alineats i a tota l'alçada de la barra */
@media (min-width: 768px) {
  #header .header-nav .row > .hidden-sm-down {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    min-height: 48px;
  }
  #header .header-nav .row > .hidden-sm-down > div {
    float: none;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
  }
  #header .header-nav #_desktop_contact_link {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
  }
  #header .header-nav #_desktop_contact_link #contact-link {
    order: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  #header .header-nav #contact-link::before,
  #header .header-nav #_desktop_contact_link::before,
  #header .header-nav #_desktop_contact_link::after {
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 18px 18px;
  }
  #header .header-nav #contact-link::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
  }
  #header .header-nav #_desktop_contact_link::after {
    order: 2;
    content: "Envío gratis desde 100 €";
    padding-left: 26px;
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6h11v10H2z'/%3E%3Cpath d='M13 9h4l4 4v3h-8'/%3E%3Ccircle cx='6' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E");
  }
  #header .header-nav #_desktop_contact_link::before {
    order: 3;
    content: "Entrega en 48 h";
    padding-left: 26px;
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  }

  /* Compte i carret */
  #header .header-nav .row > .hidden-sm-down > .right-nav {
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: stretch;
  }
  #header .header-nav #_desktop_user_info,
  #header .header-nav #_desktop_cart {
    display: flex;
    align-items: stretch;
  }
  #header .header-nav .user-info {
    margin: 0 0 0 1.5rem;
    display: flex;
    align-items: center;
  }
  #header .header-nav .user-info a {
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    font-size: .875rem;
    font-weight: 500;
  }
  #header .header-nav .user-info a .material-icons,
  #header .header-nav .blockcart .material-icons { font-size: 20px; line-height: 1; margin: 0; }
  #header .header-nav .blockcart,
  #header .header-nav .blockcart.active {
    height: auto;
    margin: 0 0 0 1.25rem;
    padding: 0 1.1rem;
    display: flex;
    align-items: center;
    background: var(--pedial-primary-dark);
  }
  #header .header-nav .blockcart .header,
  #header .header-nav .blockcart .header a {
    margin: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    font-size: .875rem;
    font-weight: 600;
  }
}
/* Pantalles mitjanes: només telèfon i enviament gratis */
@media (min-width: 768px) and (max-width: 1199px) {
  #header .header-nav #_desktop_contact_link::before { display: none; }
  #header .header-nav #_desktop_contact_link { gap: 1.5rem; }
}
#header .header-nav .user-info a:hover { color: var(--pedial-cream) !important; }

/* Fila del logo i el cercador */
#header .header-top {
  background: var(--pedial-cream);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
#header .header-top #_desktop_logo img { max-height: 70px; width: auto; }

/* Cercador */
#search_widget form input[type="text"] {
  background: #fff;
  border: 1.5px solid var(--pedial-secondary);
  border-radius: 999px;
  color: var(--pedial-black);
}
#search_widget form input[type="text"]:focus {
  outline: 2px solid var(--pedial-primary);
  outline-offset: 1px;
  color: var(--pedial-black);
}
#search_widget form i.search,
#search_widget form button[type="submit"] .material-icons { color: var(--pedial-secondary); }

/* Mòbil: la barra superior passa a crema perquè el logo vermell es vegi */
@media (max-width: 767px) {
  #header .header-nav { background: var(--pedial-cream); }
  #header .header-nav .mobile .material-icons,
  #header .header-nav .mobile .user-info a,
  #header .header-nav .mobile .blockcart .material-icons,
  #header .header-nav .mobile .blockcart .cart-products-count {
    color: var(--pedial-secondary) !important;
  }
  #header .header-nav .mobile .blockcart,
  #header .header-nav .mobile .blockcart.active {
    background: transparent;
    padding: 0;
  }
  #header .header-nav .top-logo img { max-height: 46px; width: auto; }
  #header .header-top { padding-top: .25rem; }
}

/* ---------- 3. Menú de categories (escriptori)
   El cercador es queda on era (a la dreta del logo). El menú baixa a una
   fila pròpia sota el logo, amb fons blau a tota l'amplada de la pantalla. */
@media (min-width: 768px) {
  #header { overflow-x: clip; }
  #header .header-top:has(#_desktop_top_menu li) { padding-bottom: 0; }
  #header .header-top > .container > .row:first-of-type { flex-wrap: wrap; }
  #header .header-top .header-top-right { display: contents; }
  #header .header-top #_desktop_logo { order: 1; }
  #header .header-top #search_widget { order: 2; margin-left: auto; }
  #header #_desktop_top_menu {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    position: relative;
    z-index: 5;
    margin: 1rem 0 0;
    padding: 0;
  }
  #header #_desktop_top_menu:not(:has(li)) { display: none; }
  /* Fons blau a tota l'amplada, encara que el menú visqui dins el contenidor */
  #header #_desktop_top_menu::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: var(--pedial-secondary);
    z-index: -1;
  }
  #header #_desktop_top_menu > .top-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 0;
    padding: 0;
  }
  #header #_desktop_top_menu > .top-menu > li { float: none; position: static; }
  #header .top-menu a[data-depth="0"] {
    display: block;
    color: #fff;
    font-weight: 500;
    font-size: .8125rem;
    text-transform: none;
    padding: .9rem .6rem;
    white-space: nowrap;
  }
  #header .top-menu a[data-depth="0"]:hover,
  #header .top-menu > li:hover > a[data-depth="0"],
  #header .top-menu > li.current > a[data-depth="0"] {
    color: #fff;
    background: var(--pedial-primary);
  }
  /* Desplegable (subcategories de Despensa) */
  #header .top-menu .sub-menu {
    left: 0;
    width: 100%;
    min-width: 100%;
    margin-left: 0;
    border-top: 3px solid var(--pedial-primary);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 14px 30px rgba(29, 52, 95, .18);
  }
  #header .top-menu .sub-menu ul[data-depth="1"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .25rem 1.5rem;
    padding: 1rem 1.25rem;
    margin: 0;
  }
  #header .top-menu .sub-menu ul[data-depth="1"] > li { float: none; margin: 0; }
  #header .top-menu .sub-menu a { color: var(--pedial-secondary); text-transform: none; font-weight: 600; }
  #header .top-menu .sub-menu a:hover { color: var(--pedial-primary); }
}
@media (min-width: 768px) {
  #header .top-menu .sub-menu { top: 100%; }
}
/* Mides calculades amb la Sora perquè les 9 categories càpiguen en una fila
   (a tauleta, per sota de 1200px, passen a dues files centrades) */
@media (min-width: 768px) and (max-width: 1199px) {
  #header #_desktop_top_menu > .top-menu { justify-content: center; }
  #header .top-menu a[data-depth="0"] { font-size: .75rem; padding: .75rem .5rem; }
}
@media (min-width: 1200px) {
  #header .top-menu a[data-depth="0"] { font-size: .75rem; padding: .95rem .4rem; }
}
@media (min-width: 1400px) {
  #header .top-menu a[data-depth="0"] { font-size: .875rem; padding: .95rem .45rem; }
}
@media (min-width: 1700px) {
  #header .top-menu a[data-depth="0"] { font-size: .875rem; padding: .95rem .75rem; }
}
/* Menú mòbil (desplegable de l'hamburguesa) */
#mobile_top_menu_wrapper { background: #fff; }
#mobile_top_menu_wrapper .top-menu a { color: var(--pedial-secondary); }

/* ---------- 4. Peu i newsletter */
#footer {
  background: var(--pedial-secondary);
  color: var(--pedial-footer-text);
  padding-top: 2.5rem;
}
#footer .footer-container {
  background: transparent;
  box-shadow: none;
  margin-top: 0;
  padding-top: 1.5rem;
}
#footer .footer-container li a,
#footer .footer-container a,
#footer .footer-container p,
#footer .footer-container .block-contact,
#footer .footer-container #block-contact_list,
#footer .footer-container .block-contact a {
  color: var(--pedial-footer-text);
}
#footer .footer-container li a:hover,
#footer .footer-container a:hover { color: #fff; }
#footer .footer-container .h3,
#footer .footer-container .h4,
#footer .footer-container .block-contact-title,
#footer .footer-container .myaccount-title a {
  color: var(--pedial-sky);
}
/* Text del copyright: substituït per la marca */
#footer .footer-container .text-sm-center a {
  font-size: 0;
}
#footer .footer-container .text-sm-center a::after {
  content: "© 2026 Pedial a casa · Una marca de Pedial";
  font-size: .8125rem;
  color: #b9c4da;
}
#footer .footer-container .text-sm-center { border-top: 1px solid #3a5280; padding-top: 1.25rem; }

/* Newsletter: integrada al peu blau, text blanc i botó vermell */
#footer .block_newsletter {
  background: transparent;
  color: #fff;
  border-radius: 0;
  padding: 0 15px 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #3a5280;
}
#footer #block-newsletter-label {
  color: #fff !important;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}
#footer .block_newsletter form input[type="email"] {
  background: #fff;
  color: var(--pedial-black);
  border: 0;
  border-radius: 999px;
  height: 3rem;
  padding: 0 1.25rem;
  width: 100%;
}
#footer .block_newsletter form input[type="email"]::placeholder { color: #6b6a70; }
#footer .block_newsletter form .btn-primary,
#footer .block_newsletter form input[type="submit"] {
  background: var(--pedial-primary) !important;
  border: 0;
  color: #fff !important;
  border-radius: 999px;
  height: 3rem;
  padding: 0 1.75rem;
  font-weight: 700;
  text-transform: none;
}
#footer .block_newsletter form .btn-primary:hover,
#footer .block_newsletter form input[type="submit"]:hover { background: var(--pedial-primary-dark) !important; }
#footer .block_newsletter p,
#footer .block_newsletter p *,
#footer .block_newsletter #gdpr_consent,
#footer .block_newsletter #gdpr_consent *,
#footer .block_newsletter .custom-checkbox label {
  color: #c9d3e6 !important;
  font-size: .8rem;
}
#footer .block_newsletter a { color: #fff !important; text-decoration: underline; }

/* ---------- 5. Portada (només a la pàgina d'inici) */
.pedial-home {
  --ph-red: #cf2d26;
  --ph-red-dark: #a82320;
  --ph-blue: #1d345f;
  --ph-ink: #1a181b;
  --ph-cream: #fff0dd;
  --ph-muted: #5b5a60;
}

/* Espai entre blocs de la portada */
.pedial-home > * { margin-bottom: 3rem; }

/* ---------- Capçaleres de secció (també per als mòduls de productes) */
.pedial-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-bottom: 1.25rem;
}
.pedial-section-title,
.pedial-home .featured-products .products-section-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ph-blue) !important;
  text-transform: none !important;
  text-align: left;
}
.pedial-section-link,
.pedial-home .all-product-link {
  font-weight: 600;
  color: var(--ph-red) !important;
}
.pedial-section-link:hover,
.pedial-home .all-product-link:hover { color: var(--ph-red-dark) !important; }

/* ---------- 2. Franja de confiança */
.pedial-trust {
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.pedial-trust__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
}
.pedial-trust__icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fbe4e2;
  color: var(--ph-red);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pedial-trust__icon svg,
.pedial-cat__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pedial-trust__item strong {
  display: block;
  color: var(--ph-blue);
  font-size: .95rem;
  line-height: 1.3;
}
.pedial-trust__item small {
  display: block;
  color: var(--ph-muted);
  font-size: .8rem;
  margin-top: 2px;
}

/* ---------- 3. Graella de categories */
.pedial-cats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.pedial-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pedial-cat:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(29, 52, 95, .12);
}
.pedial-cat__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ph-cream);
  color: var(--ph-red);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pedial-cat__icon svg { width: 34px; height: 34px; stroke-width: 1.6; }
.pedial-cat__name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--ph-blue);
}

/* ---------- 5. Qui som (foto + Bloque de texto personalizado) */
.pedial-about {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.pedial-about__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.pedial-about__body {
  padding: 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pedial-eyebrow {
  margin: 0 0 .75rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #b3241e;
}
/* El mòdul ps_customtext porta el seu propi fons i centrat: el traiem aquí */
.pedial-about #custom-text {
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
}
.pedial-about #custom-text * { text-align: left !important; }
.pedial-about #custom-text h2,
.pedial-about #custom-text h3 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ph-blue);
  text-transform: none;
  margin: 0 0 1rem;
}
.pedial-about #custom-text p {
  font-size: .95rem;
  line-height: 1.7;
  color: #3d3b41;
}

/* Les 9 categories en una sola fila a partir de 1200px */
@media (min-width: 1200px) {
  .pedial-cats__grid { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .75rem; }
  .pedial-cat { padding: 1.1rem .5rem; gap: .65rem; }
  .pedial-cat__icon { width: 60px; height: 60px; }
  .pedial-cat__icon svg { width: 30px; height: 30px; }
  .pedial-cat__name { font-size: .85rem; }
}
/* Menys aire entre blocs en escriptori */
@media (min-width: 768px) {
  .pedial-home > * { margin-bottom: 2.5rem; }
}

/* ---------- Mòbil i tauleta */
@media (max-width: 991px) {
  .pedial-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .pedial-home > * { margin-bottom: 2rem; }
  .pedial-trust { gap: .6rem; }
  .pedial-trust__item { flex-direction: column; text-align: center; padding: .85rem .5rem; gap: .45rem; }
  .pedial-trust__icon { width: 40px; height: 40px; }
  .pedial-trust__icon svg { width: 20px; height: 20px; }
  .pedial-trust__item strong { font-size: .8rem; }
  .pedial-trust__item small { font-size: .7rem; }
  .pedial-cats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .pedial-cat { padding: 1rem .5rem; }
  .pedial-cat__icon { width: 56px; height: 56px; }
  .pedial-cat__icon svg { width: 28px; height: 28px; }
  .pedial-cat__name { font-size: .8rem; }
  .pedial-section-title,
  .pedial-home .featured-products .products-section-title { font-size: 1.35rem; }
  .pedial-about { grid-template-columns: 1fr; }
  .pedial-about__img { min-height: 220px; }
  .pedial-about__body { padding: 1.75rem 1.25rem; }
}

/* Banner principal (mòdul Image slider) i banner del mig (mòdul Banner).
   Classic fixa el carrusel a 340px d'alçada i talla la imatge quan la pàgina
   és més ampla: deixem que l'alçada la marqui la imatge. */
.carousel .carousel-inner { height: auto !important; }
.carousel .carousel-item img { width: 100%; height: auto; display: block; }
.pedial-home #carousel,
.pedial-home .carousel { border-radius: 20px; overflow: hidden; box-shadow: none; }
.pedial-home .banner img { border-radius: 20px; width: 100%; height: auto; }

/* Mòbil i tauleta: classic fa el carrusel a tota l'amplada de la pantalla */
@media (max-width: 991px) {
  .pedial-home #carousel,
  .pedial-home .carousel { border-radius: 0; padding-bottom: 0; background-color: transparent; }
}

/* =====================================================================
   6. PÀGINES DE LLISTAT (categories, novetats, ofertes, cerca...)
   Només estructura i colors: preus, etiquetes i botons de compra
   es queden com a classic.
   ===================================================================== */

/* Molles de pa */
#wrapper .breadcrumb { background: transparent; padding-left: 0; }
#wrapper .breadcrumb li a { color: var(--pedial-secondary); }
#wrapper .breadcrumb li:last-child { color: #6b6a70; }

/* Columna esquerra: targetes blanques arrodonides */
#left-column .block-categories,
#left-column #search_filters,
#left-column #search_filters_brands,
#left-column #search_filters_suppliers {
  background: #fff;
  border-radius: 16px;
  box-shadow: none;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* Arbre de categories: "Inicio" passa a ser el títol "Categorías" */
.block-categories .category-top-menu > li:first-child > a.h6 {
  font-size: 0;
  display: block;
  margin-bottom: .75rem;
}
.block-categories .category-top-menu > li:first-child > a.h6::before {
  content: "Categorías";
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pedial-secondary);
  text-transform: none;
}
.block-categories .category-sub-menu li[data-depth="0"] > a {
  display: block;
  padding: .4rem 0;
  font-size: .9rem;
  font-weight: 500;
  color: var(--pedial-black);
  border-bottom: 1px solid #f1eee9;
}
.block-categories .category-sub-menu li[data-depth="0"]:last-child > a { border-bottom: 0; }
.block-categories .category-sub-menu li[data-depth="0"] > a:hover,
.block-categories .category-sub-link:hover { color: var(--pedial-primary); }
.block-categories .category-sub-link { color: #4a4950; font-size: .85rem; }
.block-categories .collapse-icons { top: .35rem; }
.block-categories .collapse-icons .material-icons,
.block-categories .arrows .material-icons { color: var(--pedial-primary); }

/* Icones a l'arbre de categories de la columna esquerra.
   Es reconeixen per l'ID de la categoria que porta l'URL (/10-despensa...). */
.block-categories .category-sub-menu li[data-depth="0"] > a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem 1.75rem .45rem 0;
}
.block-categories .category-sub-menu li[data-depth="0"] > a::before {
  content: "";
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--pedial-cream);
  background-image: var(--pedial-cat-icon, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.block-categories .category-sub-menu li[data-depth="0"] > a:hover::before { background-color: #fbe4e2; }
.block-categories .collapse-icons { top: .55rem; }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/10-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h8v3H8z'/%3E%3Cpath d='M7 6h10a1 1 0 0 1 1 1v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V7a1 1 0 0 1 1-1z'/%3E%3Cpath d='M6 11h12'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/12-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2h8v4l2 3v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V9l2-3z'/%3E%3Cpath d='M6 9h12'/%3E%3Cpath d='M8 6h8'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/21-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h13v5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5z'/%3E%3Cpath d='M17 11h1.5a2.5 2.5 0 0 1 0 5H17'/%3E%3Cpath d='M8 3c0 1.5 1 1.5 1 3M12 3c0 1.5 1 1.5 1 3'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/22-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11h18a9 9 0 0 1-18 0z'/%3E%3Cpath d='M8 7c1-2 3-2 4 0s3 2 4 0'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/23-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14l-2 9H7z'/%3E%3Cpath d='M5 12a7 5 0 0 1 14 0'/%3E%3Ccircle cx='12' cy='5' r='1.5'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/24-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18z'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/25-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6L12 16.4 6.7 19.4l1.2-6L3.4 9.3l6-.7z'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/26-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2h4v3h-4z'/%3E%3Cpath d='M9 5h6v3l1 2v10a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V10l1-2z'/%3E%3Cpath d='M8 13h3M8 16h3'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/27-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 9h6v11a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2z'/%3E%3Cpath d='M10 9V6h4v3'/%3E%3Cpath d='M14 6h3l1 2'/%3E%3Cpath d='M20 4l1-1M20 7h2'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/28-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h10l-1 6a4 4 0 0 1-8 0z'/%3E%3Cpath d='M12 13v8M8 21h8'/%3E%3C/svg%3E"); }
.block-categories .category-sub-menu li[data-depth="0"] > a[href*="/29-"] { --pedial-cat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cf2d26' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11h16v2a8 8 0 0 1-16 0z'/%3E%3Cpath d='M9 11c-1-3 0-6 3-7M15 11c1-2 0-4-2-5'/%3E%3C/svg%3E"); }

/* Filtres */
#search_filters > .h6,
#search_filters .facet .facet-title {
  text-transform: none !important;
  color: var(--pedial-secondary);
  font-weight: 700;
}
#search_filters > .h6 { font-size: 1.05rem; margin-bottom: .75rem; }
#search_filters .facet { padding-top: .75rem; border-top: 1px solid #f1eee9; }
#search_filters .facet .facet-title { font-size: .9rem; margin-bottom: .5rem; }
#search_filters .facet .facet-label a { color: var(--pedial-black); font-size: .85rem; }
#search_filters .facet .facet-label a:hover,
#search_filters .facet .facet-label.active a { color: var(--pedial-primary); }
#search_filters .facet .magnitude { color: #8a8790; }
#search_filters .custom-checkbox input[type="checkbox"] + span {
  border-radius: 4px;
  border-color: #b9b6b0;
}
#search_filters .custom-checkbox input[type="checkbox"] + span .checkbox-checked { color: var(--pedial-primary); }
#search_filters .ui-slider .ui-slider-range { background: var(--pedial-primary); }
#search_filters .ui-slider .ui-slider-handle { border-color: var(--pedial-primary); border-radius: 50%; }
#search_filters .btn-tertiary { color: var(--pedial-primary); }

/* Capçalera del llistat */
#main #js-product-list-header,
#main h1#js-product-list-header {
  margin-bottom: 1.25rem;
}
#main h1#js-product-list-header,
#main .block-category h1 {
  text-transform: none !important;
  color: var(--pedial-secondary);
  font-weight: 700;
  font-size: 1.9rem;
  margin: 0 0 .5rem;
}
#main .block-category {
  background: #fff;
  border: 0;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  min-height: 0;
  margin-bottom: 1.25rem;
}
#main .block-category #category-description,
#main .block-category #category-description p {
  color: #4a4950 !important;
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Subcategories: sense imatges buides, com a botons-pastilla */
#subcategories {
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 1.25rem;
}
#subcategories .subcategory-heading { display: none; }
#subcategories .subcategories-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
}
#subcategories {
  border-top: 0;
}
#subcategories ul.subcategories-list { margin: 0; justify-content: flex-start; }
#subcategories ul.subcategories-list li {
  width: auto;
  min-width: 0;
  margin: 0;
  float: none;
  text-align: left;
}
#subcategories .subcategory-image { display: none; }
#subcategories .subcategory-name,
#subcategories .subcategories-list li h5 a {
  display: inline-block;
  padding: .5rem 1rem;
  background: #fff;
  border: 1.5px solid #e6e2dc;
  border-radius: 999px;
  color: var(--pedial-secondary);
  font-size: .85rem;
  font-weight: 600;
  text-transform: none;
  margin: 0;
}
#subcategories .subcategories-list li h5 { margin: 0; }
#subcategories .subcategory-name:hover,
#subcategories .subcategories-list li h5 a:hover {
  border-color: var(--pedial-primary);
  color: var(--pedial-primary);
}
#subcategories .cat_desc { display: none; }

/* Barra de comptador i ordenació */
#products .products-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
#products .products-selection .total-products p { margin: 0; color: #6b6a70; font-size: .85rem; }
#products .products-selection .sort-by { color: #6b6a70; font-size: .85rem; white-space: nowrap; }
#products .products-sort-order .select-title {
  background: #fff;
  border: 1.5px solid #e6e2dc;
  border-radius: 999px;
  box-shadow: none;
  padding: .55rem 1rem;
  font-size: .85rem;
  color: var(--pedial-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#products .products-sort-order .select-title .material-icons { float: none; flex: none; margin: 0; }
#products .products-sort-order .dropdown-menu {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(29, 52, 95, .15);
  padding: .4rem 0;
}
#products .products-sort-order .select-list:hover { background: var(--pedial-cream); color: var(--pedial-black); }

/* Graella de productes: targetes que omplen la columna, sense forats */
#products .products,
.featured-products .products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-left: 0;
  margin-right: 0;
}
#products .products > .js-product,
.featured-products .products > .js-product {
  width: auto !important;
  max-width: none;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none;
}
#products .products .product-miniature,
.featured-products .products .product-miniature {
  display: block;
  height: 100%;
}
#products .product-miniature .thumbnail-container,
.featured-products .product-miniature .thumbnail-container {
  height: 100%;
  margin: 0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
#products .product-miniature .thumbnail-container:hover,
.featured-products .product-miniature .thumbnail-container:hover {
  box-shadow: 0 8px 22px rgba(29, 52, 95, .12);
}
#products .product-miniature .product-thumbnail img,
.featured-products .product-miniature .product-thumbnail img {
  width: 100%;
  height: auto;
}
#products .product-miniature .product-description,
.featured-products .product-miniature .product-description {
  margin-top: auto;
  padding: .5rem .75rem .9rem;
}
#products .product-miniature .product-title,
.featured-products .product-miniature .product-title { margin-top: .25rem; }
#products .product-miniature .product-title a,
.featured-products .product-miniature .product-title a {
  color: var(--pedial-black);
  font-weight: 500;
  font-size: .85rem;
  line-height: 1.35;
}
.featured-products .product-miniature .product-description::after,
#products .product-miniature .product-description::after { display: none; }

/* Columnes fixes perquè les files quedin completes (12 per pàgina, 8 a la portada) */
@media (min-width: 768px) {
  #products .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured-products .products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  #products .products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Paginació */
#products .pagination { margin-top: 1.5rem; }
#products .pagination > div:first-child { color: #6b6a70; font-size: .85rem; }
#products .pagination a { color: var(--pedial-secondary); font-weight: 600; }
#products .pagination .current a {
  color: #fff;
  background: var(--pedial-primary);
  border-radius: 8px;
  padding: .25rem .65rem;
}

@media (max-width: 767px) {
  #products .products,
  .featured-products .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }
  #main h1#js-product-list-header,
  #main .block-category h1 { font-size: 1.5rem; }
  /* En mòbil l'arbre de categories empeny els productes avall: ja hi ha el menú i les pastilles */
  #left-column .block-categories { display: none; }
  #subcategories ul.subcategories-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; justify-content: flex-start; }
  #subcategories .subcategories-list li { flex: none; }
}
