/* ============================================
   FarmBrawl — Shop Premium (horizontal catalog)
   Overrides juegoprueba.css si-* / shop-theme vertical cards.
   ============================================ */

/* ── Shell: panel tienda ── */
#view-shop.tab-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(42, 32, 22, 0.98) 0%, rgba(18, 14, 10, 0.97) 100%) !important;
  border: 3px solid #0d0a07 !important;
  box-shadow:
    0 0 0 2px rgba(232, 184, 48, 0.35),
    0 16px 48px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(245, 230, 200, 0.08) !important;
  z-index: 90;
}

/* Minimap fully hidden while shop (or any sidebar panel) is open — see minimap-premium.css */
body.shop-open #minimap-panel,
body.panel-open #minimap-panel {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.shop-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.shop-hero {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  background:
    linear-gradient(90deg, rgba(232, 184, 48, 0.12) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%),
    linear-gradient(180deg, rgba(60, 45, 30, 0.5), rgba(0, 0, 0, 0.25));
  border-bottom: 2px solid #0d0a07;
  box-shadow: inset 0 -1px 0 rgba(245, 230, 200, 0.06);
}

.shop-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.shop-hero-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5a4028, #2a1c12);
  border: 2px solid #0d0a07;
  box-shadow:
    inset 1px 1px 0 rgba(245, 230, 200, 0.15),
    0 2px 0 #0a0806;
}

.shop-hero-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
}

.shop-hero-copy {
  min-width: 0;
}

.shop-hero-copy h2 {
  margin: 0 0 4px;
  font-family: var(--font-game, 'Press Start 2P', monospace);
  font-size: 12px;
  color: #e8b830;
  text-shadow: 1px 1px 0 #000, 0 0 10px rgba(232, 184, 48, 0.25);
  letter-spacing: 0.04em;
}

.shop-hero-copy p {
  margin: 0;
  font-family: var(--font-ui, 'Nunito', sans-serif);
  font-size: 12px;
  line-height: 1.4;
  color: #b8a99a;
  max-width: 52ch;
}

.shop-hero-copy strong {
  color: #e6ddd0;
  font-weight: 800;
}

/* Hide legacy panel-head / desc inside shop when using shell */
#view-shop > .panel-head,
#view-shop > .shop-desc {
  display: none !important;
}

/* ── Filters ── */
#view-shop #shop-filters,
#view-shop .shop-filters {
  flex-shrink: 0;
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  border-bottom: 1px solid rgba(139, 115, 85, 0.2);
  background: rgba(0, 0, 0, 0.22);
}

#view-shop .si-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 8px 12px;
  font-family: var(--font-ui, 'Nunito', sans-serif);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b8a99a;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid #0d0a07;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(245, 230, 200, 0.05);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

#view-shop .si-filter i {
  font-size: 12px;
  color: #c9a227;
  opacity: 0.9;
}

#view-shop .si-filter:hover {
  color: #f0e6d4;
  background: rgba(245, 230, 200, 0.08);
  transform: translateY(-1px);
}

#view-shop .si-filter.si-filter--active {
  color: #0d0a07;
  background: linear-gradient(180deg, #e8b830, #c49a20);
  border-color: #0d0a07;
  box-shadow:
    0 2px 0 #6b4f10,
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#view-shop .si-filter.si-filter--active i {
  color: #0d0a07;
}

/* ── Catalog scroll ── */
#view-shop #shop-grid,
#view-shop .si-grid-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 12px 14px 72px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 184, 48, 0.45) transparent;
}

#view-shop #shop-grid::-webkit-scrollbar {
  width: 8px;
}
#view-shop #shop-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(232, 184, 48, 0.55), rgba(106, 176, 74, 0.35));
  border-radius: 99px;
}

/* ── Sections ── */
#view-shop .si-section {
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#view-shop .si-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 6px 4px 2px;
  font-family: var(--font-ui, 'Nunito', sans-serif) !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9a227 !important;
  text-shadow: none !important;
}

#view-shop .si-section-head i {
  color: #e8b830;
  font-size: 12px;
}

#view-shop .si-section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.45), transparent);
  margin-left: 4px;
}

/* Horizontal list (not multi-column card grid) */
#view-shop .si-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  grid-template-columns: none !important;
  align-items: stretch;
}

/* ── Horizontal card ── */
#view-shop .si-card {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  height: auto !important;
  min-height: 88px;
  padding: 10px 12px 10px 10px !important;
  text-align: left !important;
  border: 2px solid #0d0a07 !important;
  border-radius: 8px !important;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
  box-shadow:
    inset 1px 1px 0 rgba(245, 230, 200, 0.06),
    0 3px 0 rgba(0, 0, 0, 0.45) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

#view-shop .si-card:hover {
  border-color: rgba(232, 184, 48, 0.55) !important;
  transform: translateY(-1px);
  box-shadow:
    inset 1px 1px 0 rgba(245, 230, 200, 0.1),
    0 4px 0 rgba(0, 0, 0, 0.5),
    0 0 16px rgba(232, 184, 48, 0.08) !important;
}

/* Category left accent via box-shadow (not border-left stripe ban) */
#view-shop .si-card--gem {
  background:
    linear-gradient(90deg, rgba(167, 139, 250, 0.12) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card--plant {
  background:
    linear-gradient(90deg, rgba(106, 176, 74, 0.14) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card--supply {
  background:
    linear-gradient(90deg, rgba(96, 165, 250, 0.12) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card--attack {
  background:
    linear-gradient(90deg, rgba(239, 68, 68, 0.12) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card--defense {
  background:
    linear-gradient(90deg, rgba(96, 165, 250, 0.14) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card--cosmetic {
  background:
    linear-gradient(90deg, rgba(244, 114, 182, 0.1) 0%, transparent 28%),
    linear-gradient(180deg, rgba(48, 36, 26, 0.95), rgba(28, 20, 14, 0.95)) !important;
}
#view-shop .si-card.si--active,
#view-shop .si-card.si--owned {
  border-color: rgba(232, 184, 48, 0.65) !important;
}

/* Art well */
#view-shop .si-art {
  width: 72px;
  height: 72px;
  margin: 0 !important;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.55) !important;
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.06), transparent 60%),
    rgba(0, 0, 0, 0.4) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 230, 200, 0.06);
  display: grid !important;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

#view-shop .si-art--preview {
  width: 88px;
  height: 72px;
}

#view-shop .si-art-img {
  width: 52px !important;
  height: 52px !important;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
}

#view-shop .si-prev-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  image-rendering: pixelated;
}

/* Main content */
#view-shop .si-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

#view-shop .si-name {
  font-family: var(--font-ui, 'Nunito', sans-serif) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #f0e6d4 !important;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

#view-shop .si-emoji {
  margin-right: 4px;
}

#view-shop .si-desc {
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #a89888 !important;
  min-height: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#view-shop .si-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 2px;
}

#view-shop .si-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px !important;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.45) !important;
  background: rgba(0, 0, 0, 0.35) !important;
}

#view-shop .si-tag--gem { color: #c4b5fd !important; background: rgba(139, 92, 246, 0.15) !important; }
#view-shop .si-tag--defense { color: #7dd3fc !important; background: rgba(14, 165, 233, 0.12) !important; }
#view-shop .si-tag--consum { color: #fbbf24 !important; background: rgba(245, 158, 11, 0.12) !important; }
#view-shop .si-tag--raid,
#view-shop .si-tag--weapon { color: #fca5a5 !important; background: rgba(239, 68, 68, 0.12) !important; }
#view-shop .si-tag--plant { color: #86efac !important; background: rgba(34, 197, 94, 0.12) !important; }
#view-shop .si-tag--cosmetic { color: #f9a8d4 !important; background: rgba(236, 72, 153, 0.12) !important; }

#view-shop .si-gem-total {
  font-size: 12px !important;
  color: #e6ddd0 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#view-shop .si-rate {
  font-size: 11px !important;
  color: #8a7a6a !important;
}

#view-shop .si-stats {
  display: flex !important;
  gap: 6px !important;
  justify-content: flex-start !important;
}

#view-shop .si-stat {
  flex: 0 0 auto !important;
  min-width: 72px;
  padding: 4px 8px !important;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(139, 115, 85, 0.25) !important;
}

#view-shop .si-stat-l {
  font-size: 9px !important;
  color: #8a7a6a !important;
}

#view-shop .si-stat-v {
  font-size: 12px !important;
  font-family: var(--font-ui, 'Nunito', sans-serif) !important;
  font-weight: 800 !important;
  color: #6ab04a !important;
}

/* Side: prices + CTA */
#view-shop .si-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  max-width: 180px;
}

#view-shop .si-prices {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px !important;
  justify-content: flex-end !important;
}

#view-shop .si-price {
  min-width: 0 !important;
  padding: 4px 8px !important;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(0, 0, 0, 0.5) !important;
  text-align: center;
}

#view-shop .si-price-l {
  font-size: 8px !important;
  color: #8a7a6a !important;
}

#view-shop .si-price-v {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #e8b830 !important;
  font-family: var(--font-ui, 'Nunito', sans-serif) !important;
}

#view-shop .si-actions {
  display: flex !important;
  flex-direction: column;
  gap: 4px !important;
  justify-content: stretch !important;
  margin: 0 !important;
}

#view-shop .si-buy,
#view-shop .pixel-btn.si-buy {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px !important;
  font-family: var(--font-ui, 'Nunito', sans-serif) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  border-radius: 6px !important;
  border: 2px solid #0d0a07 !important;
  color: #fff !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  transition: filter 0.12s ease, transform 0.1s ease;
}

#view-shop .si-buy:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#view-shop .si-buy:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.5) !important;
}

#view-shop .si-buy:disabled {
  opacity: 0.55;
  cursor: default;
  filter: grayscale(0.4);
}

#view-shop .si-card--gem .si-buy {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9) !important;
}
#view-shop .si-card--plant .si-buy,
#view-shop .si-buy--plant {
  background: linear-gradient(180deg, #4ade80, #16a34a) !important;
}
#view-shop .si-card--supply .si-buy:not(.ghost) {
  background: linear-gradient(180deg, #60a5fa, #2563eb) !important;
}
#view-shop .si-card--attack .si-buy:not(.ghost) {
  background: linear-gradient(180deg, #f87171, #dc2626) !important;
}
#view-shop .si-card--defense .si-buy {
  background: linear-gradient(180deg, #38bdf8, #0284c7) !important;
}
#view-shop .si-card--cosmetic .si-buy {
  background: linear-gradient(180deg, #f472b6, #db2777) !important;
}
#view-shop .si-buy.ghost {
  background: linear-gradient(180deg, #6b5340, #3d2e24) !important;
  color: #e8b830 !important;
}

#view-shop .si-empty {
  padding: 32px 16px;
  text-align: center;
  color: #8a7a6a;
  font-size: 13px;
}

/* ── Responsive: stack on narrow ── */
@media (max-width: 720px) {
  #view-shop .si-card {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  #view-shop .si-art {
    width: 56px;
    height: 56px;
  }

  #view-shop .si-art-img {
    width: 40px !important;
    height: 40px !important;
  }

  #view-shop .si-side {
    grid-column: 1 / -1;
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  #view-shop .si-actions {
    flex-direction: row;
    flex: 1;
  }

  #view-shop .si-buy {
    flex: 1;
  }

  .shop-hero {
    flex-direction: column;
    gap: 8px;
  }

  .shop-hero-copy p {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-shop .si-card,
  #view-shop .si-filter,
  #view-shop .si-buy,
  body.shop-open #minimap-panel {
    transition: none !important;
  }
}
