:root {
  --brand-primary: #8E44AD;
  --brand-secondary: #D2B4DE;
  --ink: #1c1c22;
  --muted: #6b6b78;
  --bg: #ffffff;
  --surface: #f7f6f9;
  --border: #e6e3ec;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

.store-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.store-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
}
.store-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
}
.store-lema { color: var(--muted); font-size: .85rem; }

.store-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.store-nav a { color: var(--muted); font-size: .95rem; }
.store-nav a:hover { color: var(--brand-primary); }

.hero {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  padding: 56px 20px;
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { margin: 0; opacity: .92; }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

.section-title {
  font-size: 1.15rem;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.09); }
.card-img { aspect-ratio: 1/1; background: var(--surface); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-desc { color: var(--muted); font-size: .85rem; flex: 1; }
.card-price { font-weight: 700; color: var(--brand-primary); font-size: 1.05rem; }
.badge-destacado {
  align-self: flex-start;
  background: var(--brand-secondary);
  color: #3a2340;
  font-size: .7rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Ficha de producto */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.product-title { font-size: 1.8rem; margin: 0 0 6px; }
.product-desc { color: var(--muted); margin: 14px 0; }
.product-price { font-size: 1.6rem; font-weight: 800; color: var(--brand-primary); margin: 12px 0; }

.variant-list { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.variant-pill {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  background: #fff;
  font: inherit;
}
.variant-pill.active { border-color: var(--brand-primary); background: var(--surface); font-weight: 600; }
.variant-pill small { display: block; color: var(--muted); font-weight: 400; }

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.stock-info { font-size: .85rem; color: var(--muted); margin-top: 8px; }

/* Hub */
.hub-hero {
  background: #101018;
  color: #fff;
  padding: 64px 20px;
  text-align: center;
}
.hub-hero h1 { font-size: 2.4rem; margin: 0 0 10px; }
.hub-hero p { opacity: .8; margin: 0; }

.store-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.store-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
}
.store-card h3 { margin: 0 0 4px; }
.store-card .dominio { color: var(--muted); font-size: .85rem; }
.store-card .swatch { width: 40px; height: 8px; border-radius: 999px; margin-bottom: 14px; }

.store-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 20px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* --- Buscador del marketplace (hub) --- */
.hub-hero-sm { padding: 34px 20px 40px; text-align: left; }
.busc { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; margin: 22px auto 0; }
.hub-hero-sm .busc { margin-top: 0; }
.busc-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.busc-field { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.busc-field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.busc-field-grow { flex: 1 1 240px; }
.busc input, .busc select { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: .95rem; min-width: 170px; width: 100%; }
.busc input::placeholder { color: rgba(255,255,255,.65); }
.busc select option { color: #101018; }
.busc-btn { border: 0; border-radius: 10px; padding: 11px 22px; font-weight: 700; background: #fff; color: #101018; cursor: pointer; }
.busc-btn-all { background: rgba(255,255,255,.82); }
.busc-row-all { border-top: 1px dashed rgba(255,255,255,.3); padding-top: 12px; }
.busc-claro input, .busc-claro select { border-color: var(--border); background: #fff; color: #101018; }
.busc-claro input::placeholder { color: var(--muted); }
.busc-claro .busc-field > span { color: var(--muted); }
.busc-claro .busc-btn { background: var(--brand-primary); color: #fff; }
.busc-claro .busc-row-all { border-top-color: var(--border); }
.busc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.busc-resumen { color: var(--muted); font-size: .92rem; }
.res-tienda { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.res-tienda-meta { color: var(--muted); font-size: .82rem; line-height: 1.55; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 28px; }
.busc-aviso { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); color: var(--muted); }

/* Buscador dentro de la tienda (header) */
.store-search { display: flex; gap: 6px; align-items: center; }
.store-search input { border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; font-size: .88rem; width: 150px; }
.store-search button { border: 0; background: var(--brand-primary); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; }

@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { font-size: 1.5rem; }
  .hub-hero h1 { font-size: 1.7rem; }
  .busc-row { align-items: stretch; }
  .busc input, .busc select, .busc-btn { width: 100%; }
}