/* Estilos de El Rincón del Productor Español */

* {
  box-sizing:border-box}
body {
  margin:0;
  background:#f7f0df;
  color:#29332c;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
header {
  background:#28553b;
  color:white;
  padding:27px 14px;
  text-align:center}
h1 {
  font:700 29px Georgia,serif;
  margin:0 0 7px}
header div {
  font-size:15px}
.flag-es {
  display:inline-block;
  vertical-align:middle;
  width:28px;
  height:19px;
  margin-left:5px;
  border-radius:2px;
  overflow:hidden;
  position:relative;
  background:#f1c40f;
  border:1px solid rgba(0,0,0,.12)}
.flag-es:before {
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:27%;
  background:#c60b1e}
.flag-es:after {
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:27%;
  background:#c60b1e}
main {
  width:100%;
  padding:16px 12px 50px}
.catalog {
  max-width:1050px;
  margin:0 auto}
.filterbar {
  background:#fff;
  border:1px solid #ded6c6;
  border-radius:17px;
  padding:14px}
.filterbar strong {
  display:block;
  color:#28553b;
  margin-bottom:8px}
.filterbar label {
  display:inline-block;
  margin:4px;
  padding:8px 10px;
  border-radius:20px;
  background:#eef3e9;
  color:#28553b;
  font-weight:700;
  font-size:14px;
  cursor:pointer}
input[type=radio] {
  position:absolute;
  opacity:0;
  pointer-events:none}
.card {
  background:#fff;
  border:1px solid #ded6c6;
  border-radius:17px;
  padding:16px;
  margin:11px 0}
.card h3 {
  font:700 21px Georgia,serif;
  color:#28553b;
  margin:0 0 8px}
.row {
  padding:7px 0;
  border-bottom:1px solid #eee7db;
  line-height:1.45}
.row:last-of-type {
  border:0}
.label {
  font-weight:700;
  color:#665b4d}
.tag {
  display:inline-block;
  background:#eef3e9;
  color:#28553b;
  border-radius:20px;
  padding:5px 8px;
  font-size:12px;
  margin:3px 3px 6px 0}
.services {
  margin:10px 0;
  color:#28553b;
  font-weight:700;
  line-height:1.7}
.actions {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px}
.actions a {
  display:inline-block;
  min-height:40px;
  padding:9px 11px;
  border-radius:10px;
  background:#f0eee7;
  color:#29332c;
  text-decoration:none;
  font-weight:700;
  font-size:14px}
.main {
  background:#28553b!important;
  color:#fff!important}
.ig {
  background:#f7e8ef!important}
.fb {
  background:#e9eff9!important}
.tt {
  background:#eee!important}
footer {
  text-align:center;
  color:#4a4030;
  background:#d9c8a0;
  padding:25px 14px}
footer a {
  color:#28553b;
  font-weight:700}
footer a:hover,
footer a:focus-visible {
  color:#173b28}
footer .footer-links {
  margin-top:8px}
#aceite-de-oliva-y-aceituna:checked ~ .catalog .card:not(.c-aceite-de-oliva-y-aceituna) {
  display:none}
#aceite-de-oliva-y-aceituna:checked ~ .filterbar label[for="aceite-de-oliva-y-aceituna"] {
  background:#28553b;
  color:#fff}
#frutos-secos:checked ~ .catalog .card:not(.c-frutos-secos) {
  display:none}
#frutos-secos:checked ~ .filterbar label[for="frutos-secos"] {
  background:#28553b;
  color:#fff}
#producci-n-ecol-gica-y-regenerativa:checked ~ .catalog .card:not(.c-producci-n-ecol-gica-y-regenerativa) {
  display:none}
#producci-n-ecol-gica-y-regenerativa:checked ~ .filterbar label[for="producci-n-ecol-gica-y-regenerativa"] {
  background:#28553b;
  color:#fff}
#frutas-tropicales-y-subtropicales:checked ~ .catalog .card:not(.c-frutas-tropicales-y-subtropicales) {
  display:none}
#frutas-tropicales-y-subtropicales:checked ~ .filterbar label[for="frutas-tropicales-y-subtropicales"] {
  background:#28553b;
  color:#fff}
#c-tricos:checked ~ .catalog .card:not(.c-c-tricos) {
  display:none}
#c-tricos:checked ~ .filterbar label[for="c-tricos"] {
  background:#28553b;
  color:#fff}
#legumbres:checked ~ .catalog .card:not(.c-legumbres) {
  display:none}
#legumbres:checked ~ .filterbar label[for="legumbres"] {
  background:#28553b;
  color:#fff}
#miel-y-productos-ap-colas:checked ~ .catalog .card:not(.c-miel-y-productos-ap-colas) {
  display:none}
#miel-y-productos-ap-colas:checked ~ .filterbar label[for="miel-y-productos-ap-colas"] {
  background:#28553b;
  color:#fff}
#frutas:checked ~ .catalog .card:not(.c-frutas) {
  display:none}
#frutas:checked ~ .filterbar label[for="frutas"] {
  background:#28553b;
  color:#fff}
#carnes-y-aves:checked ~ .catalog .card:not(.c-carnes-y-aves) {
  display:none}
#carnes-y-aves:checked ~ .filterbar label[for="carnes-y-aves"] {
  background:#28553b;
  color:#fff}
#huevos:checked ~ .catalog .card:not(.c-huevos) {
  display:none}
#huevos:checked ~ .filterbar label[for="huevos"] {
  background:#28553b;
  color:#fff}
#chocolate-y-cacao:checked ~ .catalog .card:not(.c-chocolate-y-cacao) {
  display:none}
#chocolate-y-cacao:checked ~ .filterbar label[for="chocolate-y-cacao"] {
  background:#28553b;
  color:#fff}
#quesos-y-l-cteos:checked ~ .catalog .card:not(.c-quesos-y-l-cteos) {
  display:none}
#quesos-y-l-cteos:checked ~ .filterbar label[for="quesos-y-l-cteos"] {
  background:#28553b;
  color:#fff}
#verduras-y-hortalizas:checked ~ .catalog .card:not(.c-verduras-y-hortalizas) {
  display:none}
#verduras-y-hortalizas:checked ~ .filterbar label[for="verduras-y-hortalizas"] {
  background:#28553b;
  color:#fff}
#vinos-y-bebidas:checked ~ .catalog .card:not(.c-vinos-y-bebidas) {
  display:none}
#vinos-y-bebidas:checked ~ .filterbar label[for="vinos-y-bebidas"] {
  background:#28553b;
  color:#fff}
#artesan-a-y-productos-naturales:checked ~ .catalog .card:not(.c-artesan-a-y-productos-naturales) {
  display:none}
#artesan-a-y-productos-naturales:checked ~ .filterbar label[for="artesan-a-y-productos-naturales"] {
  background:#28553b;
  color:#fff}
#conservas-y-elaborados:checked ~ .catalog .card:not(.c-conservas-y-elaborados) {
  display:none}
#conservas-y-elaborados:checked ~ .filterbar label[for="conservas-y-elaborados"] {
  background:#28553b;
  color:#fff}
#varios:checked ~ .catalog .card:not(.c-varios) {
  display:none}
#varios:checked ~ .filterbar label[for="varios"] {
  background:#28553b;
  color:#fff}
#trufa:checked ~ .catalog .card:not(.c-trufa) {
  display:none}
#trufa:checked ~ .filterbar label[for="trufa"] {
  background:#28553b;
  color:#fff}

/* Estilos para el sistema de filtrado dinámico (JS) */
.filter-label {
  display: inline-block;
  margin: 4px;
  padding: 8px 10px;
  border-radius: 20px;
  background: #eef3e9;
  color: #28553b;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}

.filter-label:hover {
  background: #d4e8ca;
}

.filter-label.active {
  background: #28553b;
  color: #fff;
}

/* =========================================
   NUEVOS ESTILOS: HERO Y CATEGORÍAS
========================================= */

/* Sección Hero */
.hero {
  position: relative;
  background-image: linear-gradient(rgba(40, 85, 59, 0.7), rgba(40, 85, 59, 0.8)), url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?q=80&w=2000');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 80px 20px;
  margin-bottom: 30px;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-content h2 {
  font-family: Georgia, serif;
  font-size: 42px;
  margin: 0 0 15px 0;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
  font-size: 18px;
  margin: 0 0 30px 0;
  opacity: 0.9;
}

/* Buscador */
.search-container {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  gap: 15px;
}

.search-row {
  display: flex;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-radius: 30px;
  overflow: hidden;
  background: white;
}

.search-row input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  font-size: 16px;
  outline: none;
  color: #29332c;
}

.search-row button {
  background: #f1c40f;
  color: #29332c;
  border: none;
  padding: 0 30px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-row button:hover {
  background: #d4ac0d;
}

.filters-row {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.filters-row select {
  flex: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 20px;
  font-size: 15px;
  color: #28553b;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  outline: none;
  cursor: pointer;
  appearance: none;
  /* Custom arrow for dropdowns */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2328553b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 12px auto;
}

.filters-row select:disabled {
  background-color: #f0f0f0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.8;
}


/* Cuadrícula Visual de Categorías */
.filterbar-visual {
  width: 100%;
  margin-bottom: 40px;
}

.filterbar-visual[hidden] {
  display: none;
}

.categories-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 25px;
}

.filterbar-visual h2 {
  font-family: Georgia, serif;
  color: #28553b;
  text-align: center;
  margin: 0;
}

.categories-toggle {
  border: 1px solid #28553b;
  border-radius: 20px;
  background: #fff;
  color: #28553b;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.categories-toggle:hover,
.categories-toggle:focus-visible {
  background: #28553b;
  color: #fff;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
}

.cat-grid[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .categories-header {
    margin-bottom: 15px;
  }

  .categories-toggle {
    width: 100%;
  }
}

.cat-card {
  position: relative;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  text-align: center;
  /* Eliminar márgenes y paddings antiguos de .filter-label */
  margin: 0; 
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.cat-card.active {
  border: 3px solid #28553b;
}

.cat-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
  transition: filter 0.3s;
  z-index: 1;
}

.cat-card:hover .cat-bg {
  filter: brightness(0.5);
}

.cat-name {
  position: relative;
  z-index: 2;
  color: white;
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  line-height: 1.2;
}

/* Fix para el .active original que sobreescribe estilos de texto */
.cat-card.active .cat-name {
  color: #fff;
}

/* =========================================
   PÁGINAS LEGALES (Aviso Legal, Privacidad...)
========================================= */
.header-link {
  color: inherit;
  text-decoration: none;
}

.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 12px 50px;
}

.legal-back {
  display: inline-block;
  margin-bottom: 18px;
  color: #28553b;
  font-weight: 700;
  text-decoration: none;
}

.legal-back:hover,
.legal-back:focus-visible {
  text-decoration: underline;
}

.legal-card {
  background: #fff;
  border: 1px solid #ded6c6;
  border-radius: 17px;
  padding: 28px 26px;
  line-height: 1.6;
}

.legal-title {
  font: 700 30px Georgia, serif;
  color: #28553b;
  margin: 0 0 6px;
}

.legal-updated {
  color: #756b5c;
  font-size: 14px;
  margin: 0 0 20px;
}

.legal-card h2 {
  font: 700 20px Georgia, serif;
  color: #28553b;
  margin: 28px 0 10px;
}

.legal-card h3 {
  font-size: 16px;
  color: #29332c;
  margin: 18px 0 6px;
}

.legal-card p {
  margin: 0 0 12px;
}

.legal-card ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal-card li {
  margin: 4px 0;
}

.legal-card .label {
  font-weight: 700;
  color: #665b4d;
}

.legal-card a {
  color: #28553b;
  font-weight: 700;
}

/* =========================================
   BANNER DE COOKIES
========================================= */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #28553b;
  color: #fff;
  padding: 16px 20px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}

.cookie-banner-text {
  flex: 1 1 320px;
  max-width: 700px;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: #fff;
  text-decoration: underline;
  font-weight: 700;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-btn {
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.cookie-accept {
  background: #f1c40f;
  color: #29332c;
}

.cookie-accept:hover {
  background: #d4ac0d;
}

.cookie-reject {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
}

.cookie-reject:hover {
  background: rgba(255,255,255,0.12);
}

@media (max-width: 600px) {
  .cookie-banner {
    justify-content: stretch;
  }

  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* =========================================
   AVISOS PWA (actualización disponible / instalar app)
========================================= */
.pwa-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  max-width: 340px;
}

.pwa-toast-stack--above-cookie-banner {
  bottom: 96px;
}

.pwa-toast {
  background: #28553b;
  color: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-toast-text {
  font-size: 14px;
  line-height: 1.5;
}

.pwa-toast-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.pwa-toast-btn {
  border: none;
  border-radius: 20px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.pwa-toast-btn--accent {
  background: #f1c40f;
  color: #29332c;
}

.pwa-toast-btn--accent:hover {
  background: #d4ac0d;
}

.pwa-toast-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
}

.pwa-toast-btn--ghost:hover {
  background: rgba(255,255,255,0.12);
}

@media (max-width: 600px) {
  .pwa-toast-stack {
    left: 16px;
    right: 16px;
    max-width: none;
    bottom: 16px;
  }

  .pwa-toast-stack--above-cookie-banner {
    bottom: 110px;
  }
}

/* =========================================
   SECCIÓN SEO ESTÁTICA
   ========================================= */
.seo-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 16px 60px;
  color: #4a4030;
}

.seo-section h2 {
  font: 700 22px Georgia, serif;
  color: #28553b;
  margin: 0 0 14px;
  border-bottom: 2px solid #d9c8a0;
  padding-bottom: 10px;
}

.seo-section h3 {
  font: 700 17px Georgia, serif;
  color: #28553b;
  margin: 32px 0 10px;
}

.seo-intro,
.seo-categories,
.seo-regions,
.seo-proximity,
.seo-why {
  background: #fff;
  border: 1px solid #ded6c6;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
  line-height: 1.65;
  font-size: 14.5px;
}

.seo-intro h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 10px;
}

.seo-list {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.seo-list li {
  padding: 5px 0;
  border-bottom: 1px solid #f0ead8;
  font-size: 14px;
}

.seo-list li:last-child {
  border-bottom: none;
}

.seo-list--categories li::before {
  content: "🧺 ";
}

.seo-list--regions li::before {
  content: "📍 ";
}

@media (max-width: 600px) {
  .seo-intro,
  .seo-categories,
  .seo-regions,
  .seo-proximity,
  .seo-why {
    padding: 16px 14px;
  }
}
