/* FlipFinder - tema visual (cargar DESPUÉS de base.css y components.css) */
:root {
  --ff-yellow: #fff159;
  --ff-indigo: #2d2a8a;
  --ff-green: #00a650;
  --ff-bg: #f2f2f5;
  --ff-ink: #1f1f2b;
  --ff-muted: #62626f;
  --ff-line: #e4e4ea;
}
body { margin: 0; font-family: 'Roboto', Arial, sans-serif; background: var(--ff-bg); color: var(--ff-ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ff-indigo); outline-offset: 2px; }

/* Franja superior */
.ff-top { background: var(--ff-indigo); color: #fff; text-align: center; font-size: .85rem; padding: 7px 12px; }
.ff-top strong { color: var(--ff-yellow); }

/* Header */
.ff-header { background: var(--ff-yellow); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.ff-header-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px 8px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px 24px; align-items: center; }
.ff-logo { font-size: 2rem; font-weight: 900; text-decoration: none; letter-spacing: -1px; line-height: 1; }
.ff-logo .flip { color: var(--ff-indigo); }
.ff-logo .finder { color: var(--ff-green); }
.ff-search { display: flex; background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.18); overflow: hidden; }
.ff-search input { flex: 1; border: 0; padding: 12px 16px; font: inherit; outline: none; min-width: 0; }
.ff-search button { border: 0; border-left: 1px solid var(--ff-line); background: #fff; padding: 0 18px; cursor: pointer; font-size: 1.1rem; }
.ff-search:focus-within { box-shadow: 0 0 0 2px var(--ff-indigo); }
.ff-user { display: flex; gap: 20px; align-items: center; font-weight: 500; font-size: .92rem; }
.ff-user a { text-decoration: none; }
.ff-cart { display: inline-flex; align-items: center; gap: 6px; background: var(--ff-indigo); color: #fff; padding: 8px 14px; border-radius: 20px; font-weight: 700; }
.ff-nav { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; font-size: .9rem; }
.ff-nav a { text-decoration: none; opacity: .85; padding: 2px 0; }
.ff-nav a:hover { opacity: 1; text-decoration: underline; }

/* Portada */
.ff-main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 0; }
.ff-hero { background: var(--ff-indigo); color: #fff; border-radius: 12px; padding: 40px 32px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.ff-hero h1 { margin: 0 0 10px; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.5px; }
.ff-hero p { margin: 0 0 22px; font-size: 1.05rem; color: #dcdcf5; max-width: 46ch; }
.ff-cta { display: inline-block; background: var(--ff-yellow); color: var(--ff-indigo); font-weight: 700; padding: 13px 26px; border-radius: 8px; text-decoration: none; }
.ff-cta:hover { filter: brightness(.96); }
.ff-perks { display: grid; gap: 10px; }
.ff-perk { background: rgba(255,255,255,.1); border-radius: 8px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; font-size: .95rem; }
.ff-perk b { display: block; color: #fff; }
.ff-perk span.ic { font-size: 1.4rem; }
.ff-perk small { color: #cfcff0; }

/* Categorías */
.ff-section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 30px 0 12px; gap: 12px; flex-wrap: wrap; }
.ff-section-title { margin: 0; font-size: 1.3rem; font-weight: 700; }
#resultados { color: var(--ff-muted); font-size: .9rem; }
.ff-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.ff-chip { flex: 0 0 auto; border: 1px solid var(--ff-line); background: #fff; color: var(--ff-ink); padding: 8px 16px; border-radius: 20px; font: inherit; font-size: .9rem; cursor: pointer; }
.ff-chip:hover { border-color: var(--ff-indigo); }
.ff-chip[aria-pressed="true"] { background: var(--ff-indigo); border-color: var(--ff-indigo); color: #fff; }

/* Productos */
#productos-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
#productos-container .product-card { background: #fff; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
#productos-container .product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(45,42,138,.14); }
.pc-link { text-decoration: none; color: inherit; display: block; flex: 1; }
.pc-media { background: #fff; height: 210px; display: flex; align-items: center; justify-content: center; padding: 12px; border-bottom: 1px solid var(--ff-line); }
.pc-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
#productos-container .product-info { padding: 14px 14px 6px; }
#productos-container .product-price { font-size: 1.5rem; font-weight: 700; }
#productos-container .product-title { margin: 6px 0 10px; font-size: .95rem; font-weight: 400; color: #444; line-height: 1.35; min-height: 2.6em; }
.pc-badges { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.pc-badge { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.pc-ship { background: #e6f6ed; color: #00793b; }
.pc-low { background: #fff0e0; color: #b45309; }
#productos-container .btn-agregar { margin: 10px 14px 14px; padding: 11px; border: 0; border-radius: 8px; background: var(--ff-yellow); color: var(--ff-indigo); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s; }
#productos-container .btn-agregar:hover { background: #e6d84f; }
#productos-container .btn-agregar:disabled { background: #e4e4ea; color: #888; cursor: not-allowed; }
.ff-empty { grid-column: 1 / -1; background: #fff; border-radius: 10px; padding: 32px; text-align: center; color: var(--ff-muted); }
.ff-empty button { margin-top: 10px; border: 0; background: var(--ff-indigo); color: #fff; padding: 10px 18px; border-radius: 8px; font: inherit; cursor: pointer; }

/* Confianza */
.ff-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 0; }
.ff-trust div { background: #fff; border-radius: 10px; padding: 18px; display: flex; gap: 12px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ff-trust .ic { font-size: 1.6rem; }
.ff-trust b { display: block; }
.ff-trust small { color: var(--ff-muted); }

/* Footer */
.ff-footer { margin-top: 48px; background: #1f1f3a; color: #cfcfe6; }
.ff-footer-inner { max-width: 1200px; margin: 0 auto; padding: 32px 16px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ff-footer .ff-logo { font-size: 1.5rem; }
.ff-footer .ff-logo .flip { color: #fff; }
.ff-footer p { margin: 8px 0 0; font-size: .9rem; max-width: 40ch; }
.ff-copy { border-top: 1px solid rgba(255,255,255,.12); text-align: center; padding: 14px; font-size: .8rem; }

@media (max-width: 760px) {
  .ff-header-inner { grid-template-columns: 1fr auto; }
  .ff-search { grid-column: 1 / -1; order: 3; }
  .ff-user .ff-sell { display: none; }
  .ff-hero { grid-template-columns: 1fr; padding: 28px 20px; }
  .ff-hero h1 { font-size: 1.6rem; }
  #productos-container { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pc-media { height: 150px; }
  #productos-container .product-price { font-size: 1.2rem; }
  .ff-trust { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { #productos-container .product-card { transition: none; } }
/* Evita estilos de imagen heredados de components.css */
#productos-container .pc-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
}
