/* ─────────────────────────────────────────────────────────────
   Aditivos Motul (público) — estilos

   Primera parte: las reglas de style.css (v85) que usa el módulo de
   Aditivos, copiadas UNA vez (plan TB-17, D2). Se sacaron con un script que
   conserva solo las reglas cuyas clases e ids aparecen en index.html y
   aditivos.js, en el mismo orden del original. Los cambios de style.css no
   llegan aquí solos.

   Segunda parte, al final («Propio del público»): lo nuevo de esta copia.
   ───────────────────────────────────────────────────────────── */

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

[hidden] {
  display: none !important;
}

:root {
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --surface-alt: #EFEFEF;
  --border: #E5E5E5;
  --border-brand: rgba(237, 37, 47, 0.2);
  --brand: #ed252f;
  --brand-soft: rgba(237, 37, 47, 0.08);
  --brand-glow: rgba(237, 37, 47, 0.15);
  --text: #111111;
  --text-secondary: #4B5563;
  --muted: #9CA3AF;
  --dark: #1E1E1E;
  --font: 'Inter', system-ui, sans-serif;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: clip;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.3;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: #E5E5E5;
  top: -140px;
  left: -140px;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: rgba(237, 37, 47, 0.06);
  bottom: -120px;
  right: -100px;
  animation-delay: -9s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(40px, 30px) scale(1.08);
  }
}

.header-section {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8rem 12px 3rem;
  padding-top: calc(8rem + env(safe-area-inset-top));
  max-width: 1400px;
  margin: 0 auto;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 2rem;
  padding-top: max(1rem, calc(env(safe-area-inset-top, 0px) + 0.5rem));
  padding-left: max(2rem, calc(env(safe-area-inset-left, 0px) + 1rem));
  padding-right: max(2rem, calc(env(safe-area-inset-right, 0px) + 1rem));
  background: var(--dark);
  border-bottom: none;
  z-index: 100;
}

@supports (padding-top: env(safe-area-inset-top)) {
  .top-nav {
    min-height: calc(env(safe-area-inset-top, 0px) + 56px);
  }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px 8px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  width: 100px;
  cursor: pointer;
}

.back-btn:hover {
  background: rgba(237, 37, 47, 0.2);
  border-color: rgba(237, 37, 47, 0.5);
}

.nav-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

.content-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.empty-state-icon::after {
  content: '👈';
  display: inline-block;
  animation: pointing-left 1.5s ease-in-out infinite;
}

@keyframes pointing-left {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-15px);
  }
}

@keyframes pointing-down {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(15px);
  }
}

@media (max-width: 1280px) {
  .empty-state-icon::after {
    content: '👇';
    animation: pointing-down 1.5s ease-in-out infinite;
  }

  .title {
    font-size: 1.5rem;
  }
}

.show-mobile-only {
  display: none !important;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--muted);
  max-width: 320px;
}

@media (max-width: 480px) {
  .top-nav {
    padding: 0.75rem;
  }
}

.pcmo-layout {
  max-width: 1400px;
}

.pcmo-content-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  
  gap: 2rem;
  width: 100%;
}

.chart-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  position: relative;
  padding: 16px !important;
}

.filters-sidebar h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.searchable-selector {
  position: relative;
  width: 100%;
}

.selector-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.selector-control:hover {
  border-color: #D1D5DB;
}

.selector-arrow {
  width: 14px;
  height: 14px;
  opacity: 0.4;
  transition: transform 0.3s ease;
}

.searchable-selector.open .selector-arrow {
  transform: rotate(180deg);
}

.selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 1001;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.searchable-selector.open .selector-dropdown {
  display: flex;
}

.selector-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.selector-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.selector-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
}

.selector-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selector-item:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.selector-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.selector-item.disabled {
  display: none !important;
}

.selector-item span.check {
  display: none;
}

.selector-item.active span.check {
  display: block;
}

.btn-primary,
.btn-secondary {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: var(--font);
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(237, 37, 47, 0.25);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #E5E5E5;
}

@media (max-width: 1280px) {
  .page-container {
    padding-top: 6rem;
    padding-top: calc(6rem + env(safe-area-inset-top));
  }

  .pcmo-content-grid {
    display: contents;
  }

  .chart-panel {
    position: sticky;
    top: 85px;
    z-index: 10;
  }

  .content-panel {
    padding: 1.5rem !important;
  }

  .chart-panel {
    min-height: 0;
    padding: 8px 12px !important;
  }

  .chart-panel canvas {
    max-height: 85vw;
  }

  .filters-sidebar {
    position: fixed;
    bottom: -100%;
    
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    height: 85vh;
    border-radius: 24px 24px 0 0;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    transition: bottom 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    visibility: hidden;
  }

  .filters-header {
    display: none !important;
  }

  .header-section {
    margin-bottom: 4px !important;
  }

  .filters-sidebar.open {
    bottom: 0;
    visibility: visible;
  }

  #filters-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  #filters-backdrop.open {
    opacity: 1;
    visibility: visible;
  }

  .drawer-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
  }

  .drawer-footer {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  #mobile-filter-trigger {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 900;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  #mobile-filter-trigger button {
    width: 100%;
    box-shadow: 0 0 20px rgba(237, 37, 47, 0.4);
  }

  .show-mobile-only {
    display: flex !important;
  }

  .page-container {
    padding-bottom: 120px;
    
  }

  .filter-group.first-group .tooltip-text {
    bottom: auto !important;
    top: 50% !important;
    left: 100% !important;
    transform: translateY(-50%) translateX(10px) scale(0.95) !important;
    width: 210px;
    text-align: left;
  }

  .filter-group.first-group .tooltip-container:hover .tooltip-text {
    transform: translateY(-50%) translateX(15px) scale(1) !important;
  }

  .filter-group.first-group .tooltip-text::after {
    top: 50% !important;
    left: -12px !important;
    bottom: auto !important;
    margin-top: -6px !important;
    margin-left: 0 !important;
    border-color: transparent rgba(17, 24, 39, 0.95) transparent transparent !important;
  }
}

@media (min-width: 1281px) {
  #mobile-filter-trigger {
    display: none;
  }

  .drawer-header,
.drawer-footer {
    display: none;
  }
}

#global-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#global-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
  cursor: help;
  
  min-width: 24px;
  min-height: 24px;
  justify-content: center;
}

@media (max-width: 1280px) {
  .tooltip-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    
  }

  .tooltip-icon {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
  }
}

.tooltip-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  font-style: normal;
  line-height: 1;
}

.tooltip-container:hover .tooltip-icon {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tooltip-text {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px) scale(0.95);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f3f4f6;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  width: 210px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2100;
  pointer-events: none;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
}

.tooltip-container:hover .tooltip-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px) scale(1);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

.applied-filters-container {
  display: none;
  
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 0;
}

.applied-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--brand-soft);
  border: 1px solid var(--border-brand);
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: fadeInDown 0.3s ease-out;
  transition: all 0.2s ease;
}

.applied-filter-chip:hover {
  background: rgba(237, 37, 47, 0.12);
  border-color: rgba(237, 37, 47, 0.4);
}

.applied-filter-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: var(--brand);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}

.applied-filter-remove:hover {
  opacity: 1;
  transform: scale(1.2);
}

@media (max-width: 1280px) {
  .applied-filters-container {
    display: flex;
    
    margin-top: 0;
    gap: 8px;
  }

  .applied-filter-chip {
    padding: 5px 10px;
    font-size: 0.68rem;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.additive-result-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem !important;
  box-shadow: none !important;
}

@media (max-width: 1280px) {
  .additive-result-card {
    padding: 16px !important;
  }
}

.additive-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.additive-video iframe,
.additive-video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.additive-video-facade {
  padding: 0;
  background: #111;
  cursor: pointer;
}

.additive-video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.additive-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}

.additive-video-facade:hover .additive-video-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.additive-video-offline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
}

.additives-catalog {
  width: 100%;
  align-self: stretch;
}

.additives-catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.additives-catalog-search {
  position: relative;
  display: flex;
  align-items: center;
}

.additives-catalog-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.additives-catalog-search input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 42px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.additives-catalog-search input::placeholder {
  color: var(--muted);
}

.additives-catalog-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

.additives-catalog-search input:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.additives-catalog-search-clear {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.additives-catalog-search-clear:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.additives-catalog-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.additives-catalog-group + .additives-catalog-group {
  margin-top: 2rem;
}

.additives-catalog-group-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.additives-catalog-group-title::before {
  content: '';
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--brand);
  flex-shrink: 0;
}

.additives-catalog-group-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 100px;
  padding: 2px 8px;
}

.additives-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.additives-catalog-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.6rem 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .additives-catalog-card:hover {
    border-color: var(--border-brand);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }
}

.additives-catalog-card:active {
  transform: scale(0.98);
}

.additives-catalog-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.additives-catalog-card-img {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.additives-catalog-card-img img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4%;
  object-fit: contain;
}

.additives-catalog-card-name {
  
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.additives-catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 1280px) {
  .additives-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  }
}

@media (max-width: 768px) {
  .additives-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .additives-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .additives-catalog-toolbar {
    margin-bottom: 1.25rem;
  }
}

body.ficha-abierta {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}

html.ficha-gutter {
  overflow-y: scroll;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFadeIn 0.2s ease;
}

.product-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: productModalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes productModalIn {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s, color 0.15s;
}

.product-modal-close:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.product-modal-close svg {
  width: 20px;
  height: 20px;
}

.product-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem;
}

.product-modal-packshot {
  height: clamp(200px, 38vh, 300px);
  border-radius: 14px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-modal-packshot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-modal-title {
  margin-top: 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.product-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1.5rem;
}

.product-modal-tag {
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 4px 10px;
  background: var(--surface-alt);
  color: var(--text-secondary);
}

.product-modal-tag--sistema {
  background: var(--brand-soft);
  color: var(--brand);
}

.product-modal-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.product-modal-block p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.product-modal-block strong {
  font-weight: 600;
}

.product-modal-block-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-block--symptom .product-modal-block-icon {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.product-modal-block--benefit .product-modal-block-icon {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.product-modal-block p.product-modal-quote {
  color: #111827;
  font-style: italic;
  font-weight: 600;
}

.product-modal-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.product-modal-details > div {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.product-modal-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.product-modal-value {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .product-modal {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .product-modal-body {
    padding: 1rem;
  }

  .product-modal-block {
    padding: 1rem;
  }

  .product-modal-title {
    font-size: 1.3rem;
  }
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  cursor: zoom-out;
}

.modal.is-open {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  max-width: min(90vw, 480px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  cursor: default;
  animation: modalImgPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalImgPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#modal-caption {
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  opacity: 0.8;
  cursor: default;
}

.modal-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.15s ease;
  z-index: 9001;
}

.modal-close:hover {
  color: #fff;
  transform: scale(1.15);
}

/* ─────────────────────────────────────────────────────────────
   Propio del público (TB-17)
   ───────────────────────────────────────────────────────────── */

/* Encabezado: solo la marca, centrada (no hay «Volver» ni selector a los lados) */
.publico-nav {
  justify-content: center;
}

/* Página de elegir país (D8) */
.publico-paises {
  max-width: 560px;
}

.publico-paises-header {
  width: 100%;
  text-align: left;
  margin-bottom: 1.5rem;
}

.publico-paises-lista {
  list-style: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.publico-paises-item {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.publico-paises-item:hover,
.publico-paises-item:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 16px var(--brand-glow);
  outline: none;
}

/* Sin datos o sin red */
.publico-sin-datos {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 1rem;
}

.publico-sin-datos h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.publico-sin-datos p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Pie con el aviso de privacidad (D7b) */
.publico-pie {
  width: 100%;
  text-align: center;
  padding: 0 1rem calc(1.25rem + env(safe-area-inset-bottom));
  margin-top: -1rem;
}

.publico-pie-enlace {
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
}

.publico-pie-enlace span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.publico-aviso-dialogo {
  max-width: 480px;
}

.publico-aviso-cuerpo p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

.publico-aviso-cuerpo .product-modal-title {
  margin-bottom: 1rem;
  padding-right: 2.5rem;
}

.publico-aviso-mas a {
  color: var(--brand);
}

/* En celular y tableta, «Ver filtros» va fijo abajo y tapaba el pie: el
   espacio que el privado reserva al final del contenido lo toma el pie. */
@media (max-width: 1280px) {
  #vista-modulo.page-container {
    padding-bottom: 2rem;
  }

  #vista-modulo:not([hidden]) ~ .publico-pie {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* Hito 3 (Julián, 19-nov): con solo dos filtros, el cajón no necesita casi
   toda la pantalla. Queda espacio para abrir la lista de Necesidad (se
   desplaza dentro del cajón si no cabe). */
@media (max-width: 1280px) {
  .filters-sidebar {
    height: 70vh;
  }

  .filters-sidebar .selector-list {
    max-height: 190px;
  }
}

/* Hito 3: el pie se veía poco; más contraste y un poco más grande. */
.publico-pie {
  margin-top: 0;
  padding-top: 0.5rem;
}

.publico-pie-enlace {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.publico-pie-enlace span {
  color: var(--brand);
  font-weight: 600;
}
