/* AndreaWeb / MA — Mejoras de la Fase 6 (no reemplaza estilos.css ni producto.css) */

/* Selección reconocible también por su marca ✓, no solo por el color. */
.producto-swatch,
.producto-pata-card {
  position: relative;
  transition: background-color .17s, border-color .17s, box-shadow .17s;
}
.producto-swatch[aria-pressed="true"]::after,
.producto-pata-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 7px;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
}
.producto-swatch:focus-visible,
.producto-pata-card:focus-visible,
.filter-chip:focus-visible,
.theme-toggle:focus-visible,
.producto-restore:focus-visible,
.andrea-mini-ir-foto:focus-visible {
  outline: 3px solid #bd815f;
  outline-offset: 3px;
}

/* Botones más diferenciados cuando el usuario activa el modo oscuro. */
:root[data-theme="dark"] .studio-controls .producto-swatch,
:root[data-theme="dark"] .studio-leg-section .producto-pata-card {
  border: 1.5px solid #819b87;
  color: #f1f6ee;
  background-color: #34483b;
}
:root[data-theme="dark"] .studio-controls .producto-swatch:hover:not(:disabled),
:root[data-theme="dark"] .studio-leg-section .producto-pata-card:hover:not(:disabled) {
  background-color: #46614e;
  border-color: #dcead6;
}
:root[data-theme="dark"] .studio-controls .producto-swatch[aria-pressed="true"],
:root[data-theme="dark"] .studio-leg-section .producto-pata-card[aria-pressed="true"] {
  border: 2px solid #f4d0a8;
  background-color: #67523d;
  color: #ffffff;
  box-shadow: 0 0 0 1px #f4d0a8;
}
:root[data-theme="dark"] .studio-controls .producto-swatch[aria-pressed="true"] .producto-swatch-text {
  font-weight: 800;
  color: #fff;
}
:root[data-theme="dark"] .studio-controls .model-select {
  border: 1.5px solid #819b87;
  background-color: #33463a;
  color: #f5f8f2;
}
:root[data-theme="dark"] .filter-chip:not(.active) {
  background: #33463a;
  border-color: #819b87;
  color: #f5f7f0;
}
:root[data-theme="dark"] .producto-restore:not(:disabled) {
  color: #f1e4d1;
  border: 1px solid #819b87;
  padding: 11px 15px;
  border-radius: 8px;
  background: #33483b;
}
:root[data-theme="dark"] .theme-toggle {
  border: 1.5px solid #99b19b;
  background: #34483a;
  color: #fff;
}
:root[data-theme="dark"] .studio-controls .producto-swatch-dot {
  box-shadow: 0 0 0 1px #b7c7b8;
}

.andrea-mini-preview { display: none; }
.andrea-mini-preview[hidden] { display: none !important; }

@media (max-width: 760px) {
  /* La ficha de patas ahora va después de los controles en celular. */
  .studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "foto" "paletas" "patas";
    gap: 16px;
  }
  .studio-left { display: contents; }
  .studio-viewer { grid-area: foto; }
  .studio-controls { grid-area: paletas; min-width: 0; }
  .studio-leg-section { grid-area: patas; }

  /* Compacta, fijada arriba SOLO durante el recorrido por las paletas. */
  .andrea-mini-preview:not([hidden]) {
    display: flex;
    align-items: center;
    position: sticky;
    top: 8px;
    z-index: 10;
    margin: 0 0 15px;
    padding: 9px;
    gap: 11px;
    min-height: 100px;
    background: #fffaf1;
    color: #26372b;
    border: 2px solid #a1b09b;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(25, 40, 26, .18);
  }
  .andrea-mini-foto {
    width: 125px;
    min-width: 125px;
    background: #fff;
    border: 1px solid #dddcd6;
    border-radius: 7px;
    overflow: hidden;
    display: grid;
    place-items: center;
  }
  .andrea-mini-foto canvas { width: 100%; height: auto; max-height: 106px; display: block; }
  .andrea-mini-detalle { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
  .andrea-mini-detalle strong { font-size: 12px; font-weight: 800; line-height: 1.2; }
  .andrea-mini-nombre { color: #495f4b; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
  .andrea-mini-estado { color: #617b61; font-size: 10px; font-weight: 700; }
  .andrea-mini-ir-foto {
    background: #e7eee4;
    color: #25462d;
    border: 1px solid #9ab09b;
    border-radius: 6px;
    padding: 7px 8px;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    align-self: flex-start;
  }
  .andrea-mini-procesando .andrea-mini-estado { color: #9f6842; }
  .producto-swatch { min-height: 76px; }

  :root[data-theme="dark"] .andrea-mini-preview:not([hidden]) {
    background: #2b3b30;
    color: #f8f7f0;
    border-color: #a6c2a9;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .4);
  }
  :root[data-theme="dark"] .andrea-mini-nombre { color: #dcead7; }
  :root[data-theme="dark"] .andrea-mini-estado { color: #c9e0c5; }
  :root[data-theme="dark"] .andrea-mini-ir-foto {
    background: #506b54;
    color: #fff;
    border-color: #b5cdb5;
  }
}
@media (max-width: 390px) {
  .andrea-mini-foto { width: 100px; min-width: 100px; }
  .andrea-mini-preview:not([hidden]) { gap: 8px; padding: 7px; }
  .andrea-mini-foto canvas { max-height: 92px; }
  .andrea-mini-ir-foto { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .andrea-mini-ir-foto { scroll-behavior: auto; }
}
