/* ============================================================
   Arcadia PC Configurator — Stylesheet
   Tiendas Arcadia v1.0.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=DM+Sans:wght@300;400;500&display=swap');

.arcadia-pc-wrap {
  --apc-bg: #0a0a0f;
  --apc-surface: #12121a;
  --apc-surface2: #1a1a26;
  --apc-border: #2a2a3e;
  --apc-accent: #6c4ff6;
  --apc-accent2: #00d4ff;
  --apc-danger: #ff4757;
  --apc-warn: #ffa502;
  --apc-success: #2ed573;
  --apc-text: #e8e8f0;
  --apc-muted: #7a7a99;

  font-family: 'DM Sans', -apple-system, sans-serif;
  color: var(--apc-text);
  background: var(--apc-bg);
  margin: 0 -20px;
  padding: 0;
}

/* ── HEADER ───────────────────────────────────────────────── */
.apc-header {
  background: var(--apc-surface);
  border-bottom: 1px solid var(--apc-border);
  padding: 28px 40px;
}

.apc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.apc-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
  color: var(--apc-text);
}

.apc-subtitle {
  font-size: 0.85rem;
  color: var(--apc-muted);
  font-weight: 300;
  margin: 0;
}

.apc-legend {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--apc-muted);
}

.apc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.apc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apc-border);
  display: inline-block;
}

.apc-dot.ok    { background: var(--apc-success); box-shadow: 0 0 6px var(--apc-success); }
.apc-dot.warn  { background: var(--apc-warn); }
.apc-dot.error { background: var(--apc-danger); }

/* ── STEPS ────────────────────────────────────────────────── */
.apc-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  background: var(--apc-bg);
  border-bottom: 1px solid var(--apc-border);
  flex-wrap: wrap;
  gap: 4px;
}

.apc-step {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.apc-step.active { opacity: 1; }
.apc-step.done   { opacity: 0.65; }

.apc-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--apc-border);
  background: var(--apc-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
}

.apc-step.active .apc-step-num {
  background: var(--apc-accent);
  border-color: var(--apc-accent);
  box-shadow: 0 0 16px rgba(108, 79, 246, 0.5);
}

.apc-step.done .apc-step-num {
  background: rgba(46, 213, 115, 0.15);
  border-color: var(--apc-success);
  color: var(--apc-success);
}

.apc-step-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.apc-step-line {
  width: 24px;
  height: 1px;
  background: var(--apc-border);
  flex-shrink: 0;
  margin: 0 2px;
}

/* ── MAIN GRID ────────────────────────────────────────────── */
.apc-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 24px 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .apc-grid { grid-template-columns: 1fr; padding: 16px 20px 40px; }
  .apc-steps { padding: 16px 20px; }
  .apc-header { padding: 20px; }
}

/* ── CATEGORY TABS ────────────────────────────────────────── */
.apc-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.apc-cat-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--apc-border);
  color: var(--apc-muted);
  background: var(--apc-bg);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.apc-cat-tab:hover { border-color: var(--apc-accent); color: var(--apc-text); }
.apc-cat-tab.active { border-color: var(--apc-accent); color: var(--apc-text); background: rgba(108,79,246,0.12); }
.apc-cat-tab.done .apc-tab-dot { background: var(--apc-success) !important; }
.apc-cat-tab.active .apc-tab-dot { background: var(--apc-accent) !important; }

.apc-tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--apc-border);
  flex-shrink: 0;
  transition: background 0.2s;
}

.apc-required { color: var(--apc-danger); font-size: 0.7rem; }

/* ── PANEL ────────────────────────────────────────────────── */
.apc-panel {
  background: var(--apc-surface);
  border: 1px solid var(--apc-border);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.apc-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--apc-accent), var(--apc-accent2));
}

.apc-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.apc-panel-icon {
  font-size: 1.5rem;
  width: 40px;
  flex-shrink: 0;
}

.apc-panel-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.apc-panel-desc {
  font-size: 0.78rem;
  color: var(--apc-muted);
}

.apc-stock-info {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--apc-muted);
  border: 1px solid var(--apc-border);
  padding: 4px 10px;
}

/* ── ALERTAS ──────────────────────────────────────────────── */
.apc-alerts { margin-bottom: 12px; }

.apc-alert {
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  animation: apcSlideIn 0.25s ease;
}

@keyframes apcSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.apc-alert-error { background: rgba(255,71,87,0.08); border: 1px solid rgba(255,71,87,0.35); color: #ffb3b8; }
.apc-alert-warn  { background: rgba(255,165,2,0.08); border: 1px solid rgba(255,165,2,0.35); color: #ffd97a; }
.apc-alert-info  { background: rgba(0,212,255,0.05); border: 1px solid rgba(0,212,255,0.25); color: var(--apc-muted); }

/* ── CONTROLES ────────────────────────────────────────────── */
.apc-controls { margin-bottom: 14px; }

.apc-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.apc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
}

.apc-search {
  width: 100%;
  background: var(--apc-bg);
  border: 1px solid var(--apc-border);
  color: var(--apc-text);
  padding: 10px 14px 10px 38px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.apc-search:focus { border-color: var(--apc-accent); }
.apc-search::placeholder { color: var(--apc-muted); }

.apc-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.apc-filter-pill {
  font-size: 0.7rem;
  padding: 4px 12px;
  border: 1px solid var(--apc-border);
  color: var(--apc-muted);
  background: var(--apc-bg);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

.apc-filter-pill:hover { border-color: var(--apc-accent); color: var(--apc-text); }
.apc-filter-pill.active { border-color: var(--apc-accent); color: var(--apc-text); background: rgba(108,79,246,0.12); }

/* ── LOADING ──────────────────────────────────────────────── */
.apc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--apc-muted);
  font-size: 0.85rem;
}

.apc-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--apc-border);
  border-top-color: var(--apc-accent);
  border-radius: 50%;
  animation: apcSpin 0.8s linear infinite;
}

@keyframes apcSpin { to { transform: rotate(360deg); } }

/* ── LISTA DE PRODUCTOS ───────────────────────────────────── */
.apc-product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 4px;
}

.apc-product-list::-webkit-scrollbar { width: 4px; }
.apc-product-list::-webkit-scrollbar-track { background: var(--apc-bg); }
.apc-product-list::-webkit-scrollbar-thumb { background: var(--apc-accent); }

/* ── TARJETA DE PRODUCTO ──────────────────────────────────── */
.apc-product-card {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--apc-bg);
  border: 1px solid var(--apc-border);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.apc-product-card:hover {
  border-color: var(--apc-accent);
  background: rgba(108,79,246,0.04);
}

.apc-product-card.selected {
  border-color: var(--apc-accent);
  background: rgba(108,79,246,0.08);
  box-shadow: inset 0 0 0 1px var(--apc-accent);
}

.apc-product-card.incompatible {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255,71,87,0.35);
}

.apc-product-card.incompatible:hover {
  border-color: var(--apc-danger);
  background: rgba(255,71,87,0.04);
}

.apc-product-card.warning {
  border-color: rgba(255,165,2,0.3);
}

.apc-card-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--apc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.apc-card-radio.checked {
  border-color: var(--apc-accent);
  background: var(--apc-accent);
  box-shadow: 0 0 0 3px rgba(108,79,246,0.2);
}

.apc-card-radio.checked::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
}

.apc-card-name {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 5px;
  color: var(--apc-text);
}

.apc-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.apc-sku {
  font-size: 0.62rem;
  color: var(--apc-muted);
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.04em;
}

.apc-stock {
  font-size: 0.62rem;
  padding: 2px 7px;
  border: 1px solid;
  font-weight: 500;
}

.apc-stock-ok  { background: rgba(46,213,115,0.08); border-color: rgba(46,213,115,0.3); color: var(--apc-success); }
.apc-stock-low { background: rgba(255,165,2,0.08); border-color: rgba(255,165,2,0.3); color: var(--apc-warn); }

.apc-attr-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  background: rgba(108,79,246,0.1);
  border: 1px solid rgba(108,79,246,0.25);
  color: var(--apc-accent2);
  white-space: nowrap;
}

.apc-badge-error {
  font-size: 0.6rem;
  padding: 2px 7px;
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.35);
  color: var(--apc-danger);
}

.apc-badge-warn {
  font-size: 0.6rem;
  padding: 2px 7px;
  background: rgba(255,165,2,0.1);
  border: 1px solid rgba(255,165,2,0.3);
  color: var(--apc-warn);
}

.apc-card-issue {
  font-size: 0.7rem;
  color: var(--apc-danger);
  margin-top: 5px;
  line-height: 1.4;
}

.apc-product-card.incompatible .apc-card-issue { color: #ff6b7a; }

.apc-card-price {
  text-align: right;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-family: 'Orbitron', monospace;
  color: var(--apc-accent2);
  white-space: nowrap;
}

/* Sobrescribir estilos de precio de WooCommerce */
.apc-card-price .woocommerce-Price-amount { color: var(--apc-accent2) !important; }
.apc-card-price .woocommerce-Price-currencySymbol { font-size: 0.7rem; }

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

.apc-empty-icon { font-size: 2rem; margin-bottom: 8px; display: block; }

/* ── SKIP + NAV ───────────────────────────────────────────── */
.apc-skip-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.apc-btn-skip {
  font-size: 0.72rem;
  color: var(--apc-muted);
  background: none;
  border: 1px dashed var(--apc-border);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.apc-btn-skip:hover { border-color: var(--apc-muted); color: var(--apc-text); }

.apc-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.apc-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.apc-btn-primary { background: var(--apc-accent); color: white; flex: 1; }
.apc-btn-primary:hover:not(:disabled) { background: #7c5ff8; box-shadow: 0 0 20px rgba(108,79,246,0.35); }
.apc-btn-primary:disabled { background: var(--apc-border); color: var(--apc-muted); cursor: not-allowed; }

.apc-btn-ghost { background: transparent; border: 1px solid var(--apc-border); color: var(--apc-muted); }
.apc-btn-ghost:hover:not(:disabled) { border-color: var(--apc-muted); color: var(--apc-text); }
.apc-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── PANEL DERECHO ────────────────────────────────────────── */
.apc-summary { display: flex; flex-direction: column; gap: 14px; }

.apc-summary-card,
.apc-watt-card,
.apc-total-card {
  background: var(--apc-surface);
  border: 1px solid var(--apc-border);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.apc-summary-card::before,
.apc-watt-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--apc-accent2), transparent);
}

.apc-total-card {
  border-color: var(--apc-accent);
  box-shadow: 0 0 30px rgba(108,79,246,0.12);
}

.apc-total-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--apc-accent), var(--apc-accent2));
}

.apc-summary-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--apc-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.apc-summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--apc-border);
  gap: 8px;
}

.apc-summary-row:last-child { border-bottom: none; }

.apc-sum-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.apc-sum-icon { font-size: 0.9rem; width: 18px; }
.apc-sum-label { font-size: 0.65rem; color: var(--apc-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }

.apc-sum-product { text-align: right; }
.apc-sum-name { display: block; font-size: 0.72rem; font-weight: 500; line-height: 1.3; }
.apc-sum-sku  { font-size: 0.58rem; color: var(--apc-accent2); font-family: 'Orbitron', monospace; }
.apc-sum-empty { font-size: 0.7rem; color: var(--apc-border); font-style: italic; }

/* ── WATTS ────────────────────────────────────────────────── */
.apc-watt-bar-wrap {
  background: var(--apc-bg);
  height: 7px;
  border: 1px solid var(--apc-border);
  overflow: hidden;
  margin-bottom: 8px;
}

.apc-watt-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--apc-success), var(--apc-accent2));
  transition: width 0.5s ease;
}

.apc-watt-bar.warn   { background: linear-gradient(90deg, var(--apc-warn), #ff8c00); }
.apc-watt-bar.danger { background: linear-gradient(90deg, var(--apc-danger), #ff8c00); }

.apc-watt-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--apc-muted);
  flex-wrap: wrap;
  gap: 4px;
}

.apc-watt-info strong { color: var(--apc-text); font-family: 'Orbitron', monospace; font-size: 0.72rem; }

/* ── STATUS ───────────────────────────────────────────────── */
.apc-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--apc-surface);
  border: 1px solid var(--apc-border);
  font-size: 0.75rem;
}

.apc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apc-border);
  flex-shrink: 0;
  transition: all 0.3s;
}

.apc-status-dot.ok    { background: var(--apc-success); box-shadow: 0 0 8px var(--apc-success); }
.apc-status-dot.warn  { background: var(--apc-warn); box-shadow: 0 0 8px var(--apc-warn); }
.apc-status-dot.error { background: var(--apc-danger); box-shadow: 0 0 8px var(--apc-danger); animation: apcBlink 1s infinite; }

@keyframes apcBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.apc-issues-list {
  background: rgba(255,71,87,0.06);
  border: 1px solid rgba(255,71,87,0.25);
  padding: 10px 14px;
}

.apc-issue-item {
  font-size: 0.72rem;
  color: #ffb3b8;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,71,87,0.15);
  line-height: 1.4;
}

.apc-issue-item:last-child { border-bottom: none; }

/* ── TOTAL ────────────────────────────────────────────────── */
.apc-total-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--apc-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.apc-total-price {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--apc-accent2);
  line-height: 1;
  margin-bottom: 2px;
  text-shadow: 0 0 20px rgba(0,212,255,0.25);
}

.apc-total-count {
  font-size: 0.72rem;
  color: var(--apc-muted);
  margin-bottom: 16px;
}

.apc-btn-cart {
  width: 100%;
  background: linear-gradient(135deg, var(--apc-accent), #9b59b6);
  color: white;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.apc-btn-cart:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,79,246,0.4);
}

.apc-btn-cart:disabled {
  background: var(--apc-border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.apc-cart-icon { font-size: 1rem; }
.apc-cart-note { font-size: 0.68rem; color: var(--apc-muted); text-align: center; min-height: 18px; }

/* ── SHARE ────────────────────────────────────────────────── */
.apc-share {
  display: flex;
  gap: 8px;
}

.apc-btn-share {
  flex: 1;
  font-size: 0.68rem;
  padding: 8px 10px;
  background: var(--apc-surface);
  border: 1px solid var(--apc-border);
  color: var(--apc-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.apc-btn-share:hover { border-color: var(--apc-muted); color: var(--apc-text); }

/* ── MODAL ────────────────────────────────────────────────── */
.apc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.apc-modal-box {
  background: var(--apc-surface);
  border: 1px solid var(--apc-accent);
  padding: 28px;
  max-width: 480px;
  width: 90%;
}

.apc-modal-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.apc-share-url {
  width: 100%;
  background: var(--apc-bg);
  border: 1px solid var(--apc-border);
  color: var(--apc-muted);
  padding: 10px 12px;
  font-size: 0.78rem;
  margin-bottom: 14px;
  font-family: monospace;
  outline: none;
}

.apc-modal-actions { display: flex; gap: 10px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .apc-header-inner { flex-direction: column; align-items: flex-start; }
  .apc-legend { display: none; }
  .apc-step-label { display: none; }
  .apc-step-line { width: 12px; }
  .apc-panel-head { flex-direction: column; align-items: flex-start; }
  .apc-stock-info { display: none; }
}
