/* ============================================================
 Listado.css
============================================================ */
:root
{
  --bg: #0f172a;
  --card-bg: #020617;
  --card-border: #1e293b;
  --accent: #38bdf8;
  --accent-soft: rgba(56,189,248,0.1);
  --text: #e5e7eb;
  --muted: #9ca3af;
  /* Tamaños (ajusta aquí) */
  --card-w: 280px;
  --card-h: 400px;
  --media-h: 170px;
  --gap: 16px;
}

.sonon-shell
{
  background: #1D1D1D;
  color: var(--text);
  margin: 0;
  height: 100dvh;
  /* clave móvil */
  overflow: hidden;
  /* evita scroll del body -> 1 sola barra */
}

.sonon-shell a
{
  color: inherit;
  text-decoration: none;
}

.sonon-shell a:hover
{
  opacity: 0.95;
}

/* La columna principal ocupa todo el alto */
.sonon-right
{
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* clave para que el hijo scrollee */
}

/* Content como columna */
.sonon-right .content
{
  flex: 1 1 auto;
  min-height: 0;
  /* clave */
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER LISTADO
============================================================ */
.sonon-header
{
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #E11D48;
  flex: 0 0 auto;
}

.sonon-header__left
{
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.sonon-header__logo
{
  height: 40px;
  width: auto;
  display: block;
}

.sonon-header__titlewrap
{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sonon-header__title
{
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sonon-header__meta
{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.sonon-header__right
{
  display: flex;
  align-items: center;
}

/* Evitar overlays/acciones sobre imágenes (Edge Visual Search / drag / selección) */
.sonon-card img
{
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  /* importante: evita interacciones sobre la img */
}

/* Como pointer-events:none en la img, asegúrate de que el click siga funcionando en la card */
.sonon-card
{
  cursor: pointer;
}

/*Boton volver*/
.sonon-action-btn
{
  background: #E11D48;
  font-weight: 500;
  padding: 0.5em 1.6em;
  color: #FFFFFF;
  border: 2px solid #E11D48;
  display: block;
  float: left;
  border-radius: 6px;
}

.sonon-action-btn:hover
{
  background: rgba(225, 29, 72, 0.22);
  border-color: rgba(225, 29, 72, 0.95);
}

/* Search */
.sonon-search
{
  position: relative;
  width: min(440px, 44vw);
  max-width: 100%;
  flex: 1 1 440px;
  min-width: 220px;
}

.sonon-search,
.sonon-search *
{
  box-sizing: border-box;
}

.sonon-search__input::-webkit-search-decoration,
.sonon-search__input::-webkit-search-cancel-button,
.sonon-search__input::-webkit-search-results-button,
.sonon-search__input::-webkit-search-results-decoration
{
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.sonon-search__input[type="search"]
{
  -webkit-appearance: none;
  appearance: none;
}

.sonon-search__input
{
  width: 100%;
  max-width: 100%;
  background: #1D1D1D;
  border: 1px solid #1F2937;
  color: #E5E7EB;
  border-radius: 10px;
  padding: 14px 40px 14px 38px;
  outline: none;
}

.sonon-search__input::placeholder
{
  color: rgba(229, 231, 235, 0.55);
}

.sonon-search__input:focus
{
  border-color: #E11D48;
  box-shadow: 0 0 0 1px #E11D48;
}

.sonon-search__icon
{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.75;
  pointer-events: none;
  font-size: 14px;
  color: #E5E7EB;
}

/* ============================================================
   SCROLL PRINCIPAL (ÚNICO SCROLLER)
============================================================ */
.sonon-scroll
{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.10);
  padding: 12px 10px 14px 14px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) rgba(255,255,255,.06);
}

/* WebKit scrollbar (Chrome/Edge/Safari) */
.sonon-scroll::-webkit-scrollbar
{
  width: 10px;
  height: 10px;
}

.sonon-scroll::-webkit-scrollbar-track
{
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin: 10px 0;
}

.sonon-scroll::-webkit-scrollbar-thumb
{
  background: rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.35);
  background-clip: padding-box;
}

.sonon-scroll::-webkit-scrollbar-thumb:hover
{
  background: rgba(255, 255, 255, 0.30);
}

.sonon-scroll::-webkit-scrollbar-thumb:active
{
  background: rgba(255, 255, 255, 0.38);
}

.sonon-scroll::-webkit-scrollbar-corner
{
  background: transparent;
}

.sonon-scroll::-webkit-scrollbar-button, .sonon-scroll::-webkit-scrollbar-button:single-button
{
  display: none;
  width: 0;
  height: 0;
}

/* ============================================================
   GRID + CARD (tamaño fijo)
============================================================ */
.grid
{
  display: grid;
  gap: var(--gap);
  margin-top: 24px;
  grid-template-columns: repeat(auto-fill, var(--card-w));
  justify-content: center;
  align-items: stretch;
}

/* Selectores configurador*/
.cfg-group
{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.cfg-group-head
{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cfg-group-title
{
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: #FFFFFF !important;
}

.cfg-group-meta
{
  font-size: 12px;
  opacity: 0.6;
}

/* Card */
.sonon-card
{
  height: var(--card-h);
  display: flex;
}

.sonon-card-inner
{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  cursor: pointer;
}

/* Imagen */
.image-wrapper
{
  border-radius: 12px;
  overflow: hidden;
  background: rgba(195, 195, 195, 0.095);
  border: 1px solid rgba(15, 23, 42, 0.177);
  height: var(--media-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img
{
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

.fallback-img
{
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Textos */
.product-title
{
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
  margin-bottom: 6px;
}

.product-ref
{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compat-title
{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Compat (scroll interno card) */
.compat-list
{
  margin-top: 8px;
  padding-left: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  list-style: disc;
  list-style-position: outside;
  margin-bottom: 9px;
}

.compat-list::-webkit-scrollbar
{
  width: 8px;
}

.compat-list::-webkit-scrollbar-track
{
  background: transparent;
}

.compat-list::-webkit-scrollbar-thumb
{
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.compat-list::-webkit-scrollbar-button, .compat-list::-webkit-scrollbar-button:single-button
{
  display: none;
  width: 0;
  height: 0;
}

.compat-item
{
  font-size: 13px;
  margin-bottom: 4px;
  color: #DBDBDB !important;
}

.compat-item span
{
  color: var(--muted);
}

/* Meta */
.meta-row
{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.category
{
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price
{
  font-size: 15px;
  font-weight: 600;
}

.tag-badge
{
  margin-top: 6px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.tag-badge-dot
{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.empty
{
  margin-top: 32px;
  font-size: 14px;
  color: var(--muted);
}

/* ============================================================
   Precio estilo MediaMarkt
============================================================ */
.mm-price
{
  display: inline-flex;
  align-items: flex-start;
  color: #000;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  white-space: nowrap;
  margin-bottom: 16px;
  position: relative;
}

.mm-price__euros,
.mm-price__comma
{
  font-size: 50px;
}

.mm-price__cents
{
  font-size: 25px;
  transform: translateY(0.1em);
  margin-left: -0.5em;
}

.mm-price__currency
{
  font-size: 1em;
  transform: translateY(0.3em);
  margin-left: 0.08em;
}

.mm-price-note
{
  display: inline-block;
  transform: translateY(0.3em);
  margin-left: -1rem;
  font-size: 12px;
  font-weight: bold;
}

/* Inclinado suave estilo MediaMarkt */
.mm-price--outline
{
  display: inline-flex;
  transform: skewX(-8deg);
}

/* Contorno blanco */
.mm-price--outline .mm-price__euros,
.mm-price--outline .mm-price__comma
{
  -webkit-text-stroke: 2px #fff;
  text-stroke: 2px #fff;
  paint-order: stroke fill;
  text-shadow: 0 1px 0 #FFF, 0 -1px 0 #FFF, 1px 0 0 #FFF, -1px 0 0 #FFF, 1px 1px 0 #FFF, -1px -1px 0 #FFF, 1px -1px 0 #FFF, -1px 1px 0 #FFF;
}

.mm-price--outline .mm-price__cents,
.mm-price--outline .mm-price__currency
{
  -webkit-text-stroke: 1px #fff;
  text-stroke: 1px #fff;
  paint-order: stroke fill;
  text-shadow: 0 1px 0 #FFF, 0 -1px 0 #FFF, 1px 0 0 #FFF, -1px 0 0 #FFF;
}

/* Modal: compatibilidades con scroll cuando hay muchas */
.img-modal-compat #imgDialogCompatList
{
  max-height: 180px;
  /* ajusta a tu diseño */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  /* para que el scroll no pise el texto */
}

/* --- WATERMARK (forzado) --- */
.sonon-imgmodal__imgwrap
{
  position: relative;
}

.sonon-imgmodal__watermark
{
  position: absolute;
  inset: 0;
  z-index: 3;
  /* por encima de la imagen */
  pointer-events: none;
  /* AJUSTA la ruta */
  background-image: url("/img/logo.png");
  background-repeat: repeat;
  background-size: 160px auto;
  background-position: center;
  opacity: 0.10;
  /* visible */
  mix-blend-mode: screen;
}

/* la imagen por debajo */
#imgDialogPreview
{
  position: relative;
  z-index: 2;
}

/* --- PROTECCIÓN / FRICCIÓN --- */
.sonon-imgmodal,
.sonon-imgmodal *
{
  -webkit-user-select: none;
  user-select: none;
}

.sonon-imgmodal img
{
  -webkit-user-drag: none;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 820px)
{
  .sonon-header
  {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sonon-header__right
  {
    width: 100%;
  }
  
  .sonon-search
  {
    width: 100%;
  }
  
  .sonon-header__back
  {
    display: none;
  }
}

@media (max-width: 768px)
{
  .sonon-modal__dialog
  {
    padding: 16px;
  }
  
  .sonon-modal__content
  {
    grid-template-columns: 1fr;
    gap: 16px;
    max-height: calc(90vh - 32px);
  }
  
  .sonon-modal__image-wrapper
  {
    max-height: 45vh;
  }
  
  .sonon-footer__contact
  {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .sonon-footer__item a
  {
    justify-content: center;
  }
}

@media (max-width: 640px)
{
  h1
  {
    font-size: 22px;
  }
  
  :root
  {
    --card-w: 240px;
    --card-h: 340px;
    --media-h: 150px;
  }
}

@media (min-width: 1400px)
{
  .sonon-modal__dialog
  {
    max-width: 1200px;
  }
  
  .sonon-modal__content
  {
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
  }
  
  .sonon-modal__image-wrapper
  {
    max-height: 80vh;
  }
}
