/* ── Variables ── */
:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --accent: #f4a261;
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1e1e1e;
  --surface: #1a1a1a;
  --surface2: #222222;
  --text: #f0f0f0;
  --text-light: #999999;
  --border: #2e2e2e;
  --success: #2dc653;
  --danger: #e63946;
  --warning: #f4a261;
  --gold: #ffd60a;
  --sidebar-w: 250px;
  --nav-h: 64px;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }
/* Footer siempre abajo en las páginas de tienda, aunque el contenido sea corto */
body:not(.login-page):not(.panel-page) { min-height: 100vh; display: flex; flex-direction: column; }
body:not(.login-page):not(.panel-page) .footer { margin-top: auto; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
html { scroll-behavior: smooth; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Utilidades ── */
.hidden { display: none !important; }
.full-width { width: 100%; }
.loading-spinner { text-align: center; padding: 3rem; color: var(--text-light); font-size: 1.1rem; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3rem;
}
.nav-brand {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.4rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none; cursor: pointer;
}
.nav-brand i { color: var(--primary); font-size: 1.6rem; }
.brand-logo { height: 40px; width: auto; object-fit: contain; display: block; }
.brand-logo-lg { height: 64px; }
.login-logo .brand-logo { margin: 0 auto; }
.footer-brand .brand-logo { margin-bottom: .3rem; }
.nav-brand span em { color: var(--primary); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; padding: .3rem; }
.nav-link {
  padding: .45rem 1rem; border-radius: 8px;
  font-weight: 500; color: var(--text-light);
  transition: color .2s, background .2s; font-size: .9rem;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); }
.btn-worker {
  background: var(--primary); color: #fff !important;
  border-radius: 8px; padding: .45rem 1.1rem; font-weight: 600;
}
.btn-worker:hover { background: var(--primary-dark); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--primary); color: #fff;
  padding: .7rem 1.6rem; border-radius: 8px;
  font-weight: 600; font-size: .95rem;
  transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
  padding: .55rem 1.2rem; border-radius: 8px;
  font-weight: 500; transition: background .2s;
}
.btn-secondary:hover { background: var(--bg3); }
.btn-danger {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--danger); color: #fff;
  padding: .4rem .9rem; border-radius: 6px;
  font-size: .85rem; font-weight: 600;
}
.btn-meli {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--gold); color: #000;
  padding: .7rem 1.6rem; border-radius: 8px;
  font-weight: 700; font-size: 1rem; margin: 1rem 0;
  transition: background .2s;
}
.btn-meli:hover { background: #e6c300; }

/* ── Alerts ── */
.alert { padding: .7rem 1rem; border-radius: 8px; font-size: .9rem; margin: .5rem 0; }
.alert-error { background: rgba(230,57,70,0.15); color: #ff6b6b; border: 1px solid rgba(230,57,70,0.3); }
.alert-success { background: rgba(45,198,83,0.15); color: #2dc653; border: 1px solid rgba(45,198,83,0.3); }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden;
  min-height: 88vh;
  display: flex; align-items: center;
  background: var(--bg);
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(230,57,70,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(244,162,97,0.08) 0%, transparent 50%);
}
.hero-vinyl {
  position: absolute; right: -80px; top: 50%;
  transform: translateY(-50%);
  width: 600px; height: 600px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1a1a1a 0%, #2a2a2a 20%, #111 40%, #222 60%, #1a1a1a 80%, #333 100%);
  opacity: .25;
  animation: spin 20s linear infinite;
}
.hero-vinyl::after {
  content: ''; position: absolute; inset: 40%;
  border-radius: 50%; background: var(--bg);
  box-shadow: 0 0 0 3px #333;
}
@keyframes spin { from { transform: translateY(-50%) rotate(0deg); } to { transform: translateY(-50%) rotate(360deg); } }

.hero-content {
  position: relative; z-index: 2;
  padding: 0 4rem; max-width: 700px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(230,57,70,0.15); color: var(--primary);
  border: 1px solid rgba(230,57,70,0.3);
  padding: .3rem .8rem; border-radius: 20px;
  font-size: .8rem; font-weight: 600; margin-bottom: 1.5rem;
  letter-spacing: .5px; text-transform: uppercase;
}
.hero-content h1 {
  font-size: 4rem; font-weight: 900; line-height: 1.1;
  margin-bottom: 1.2rem; letter-spacing: -2px;
}
.hero-content h1 span { color: var(--primary); }
.hero-content p { font-size: 1.15rem; color: var(--text-light); margin-bottom: 2.5rem; line-height: 1.7; max-width: 480px; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2.8rem;
  margin-top: 2.8rem; padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  width: fit-content;
}
.hero-stat { text-align: left; }
.hero-stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.hero-stat span { font-size: .8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }

/* ── Section ── */
.section { padding: 4rem; }
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.section-header h2 {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -1px;
}
.section-header h2 span { color: var(--primary); }
.link-all { color: var(--primary); font-weight: 600; font-size: .9rem; }
.link-all:hover { text-decoration: underline; }

/* ── Features ── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; padding: 0 4rem 4rem;
}
.feature-card {
  padding: 1.8rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.feature-card i { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; display: block; }
.feature-card h3 { font-size: 1rem; margin-bottom: .5rem; font-weight: 700; }
.feature-card p { color: var(--text-light); font-size: .875rem; line-height: 1.6; }

/* ── Page Header ── */
.page-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 4rem;
}
.page-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: .3rem; }
.page-header p { color: var(--text-light); font-size: .9rem; }

/* ── Catalog toolbar ── */
.catalog-toolbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem 4rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.search-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem 1rem; flex: 1; min-width: 200px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box i { color: var(--text-light); }
.search-box input { border: none; background: none; outline: none; width: 100%; font-size: .95rem; color: var(--text); }
.search-box input::placeholder { color: var(--text-light); }
.filter-group { display: flex; gap: .8rem; flex-wrap: wrap; }
.filter-group select {
  padding: .55rem 1rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg3); color: var(--text);
  font-size: .9rem; cursor: pointer;
}
.filter-group select:focus { outline: none; border-color: var(--primary); }

.container { padding: 2rem 4rem; }
.product-count { color: var(--text-light); margin-bottom: 1.2rem; font-size: .85rem; }

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}
.product-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.product-card-img-wrap {
  position: relative; aspect-ratio: 1;
  background: var(--bg3); overflow: hidden;
  display: block; cursor: pointer;
}
.product-card img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 1.2rem; transition: transform .3s;
}
.product-card:hover img { transform: scale(1.05); }
.product-card-overlay {
  position: absolute; inset: 0;
  background: rgba(230,57,70,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
  font-size: .9rem; font-weight: 600; color: #fff; gap: .4rem;
}
.product-card:hover .product-card-overlay { opacity: 1; }
.product-card-body { padding: 1rem; }
.product-card-title {
  font-size: .88rem; font-weight: 600; color: var(--text); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: .6rem; line-height: 1.4;
}
a.product-card-title:hover { color: var(--primary); }
.product-card-price { font-size: 1.25rem; font-weight: 800; color: var(--text); margin-bottom: .4rem; }
.product-card-stock { font-size: .78rem; }
.stock-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .7rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
}
.stock-ok { background: rgba(45,198,83,0.15); color: var(--success); }
.stock-low { background: rgba(244,162,97,0.15); color: var(--warning); }
.stock-out { background: rgba(230,57,70,0.15); color: var(--danger); }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; background: var(--surface);
  border-radius: var(--radius); padding: 2rem;
  max-width: 500px; width: 90%; max-height: 90vh;
  overflow-y: auto; border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  color: var(--text-light); background: var(--bg3);
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-product-img {
  width: 160px; height: 160px; object-fit: contain;
  display: block; margin: 0 auto 1.2rem;
  background: var(--bg3); border-radius: 8px; padding: 1rem;
}
.modal-product-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1.2rem; line-height: 1.4; }
.modal-info { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
.modal-info-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .9rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.modal-info-row span:first-child { color: var(--text-light); }
.modal-info-row span:last-child { font-weight: 600; }

/* ── Login ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 30% 50%, rgba(230,57,70,0.1) 0%, transparent 50%);
}
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 2.5rem; border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; margin: .5rem 0 .2rem; letter-spacing: -0.5px; }
.login-logo p { color: var(--text-light); font-size: .85rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .5rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .7rem 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; outline: none;
  background: var(--bg3); color: var(--text);
  transition: border .2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.input-icon-right { position: relative; }
.input-icon-right input { padding-right: 2.8rem; }
.toggle-pass {
  position: absolute; right: .8rem; top: 50%;
  transform: translateY(-50%); color: var(--text-light); font-size: .9rem;
}
.back-link { display: block; text-align: center; margin-top: 1.2rem; color: var(--text-light); font-size: .85rem; }
.back-link:hover { color: var(--primary); }

/* ── Panel Layout ── */
.panel-page { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: var(--sidebar-w); background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  transition: transform .3s; z-index: 200;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.5px;
}
.sidebar-brand i { color: var(--primary); }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .75rem 1.5rem; color: var(--text-light);
  font-size: .9rem; transition: background .2s, color .2s;
}
.sidebar-link:hover { background: var(--bg3); color: var(--text); }
.sidebar-link.active { background: rgba(230,57,70,0.1); color: var(--primary); border-right: 3px solid var(--primary); }
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.user-info { font-size: .82rem; color: var(--text-light); margin-bottom: .8rem; }
.user-info strong { display: block; color: var(--text); font-size: .9rem; }
.btn-logout {
  display: flex; align-items: center; gap: .5rem;
  color: var(--text-light); font-size: .85rem; transition: color .2s;
}
.btn-logout:hover { color: var(--danger); }

.panel-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.panel-topbar {
  height: 56px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { font-size: 1.2rem; color: var(--text); display: none; }
.meli-status { font-size: .82rem; display: flex; align-items: center; gap: .4rem; }
.meli-status.connected { color: var(--success); }
.meli-status.disconnected { color: var(--danger); }

.panel-section { display: none; padding: 2rem; }
.panel-section.active { display: block; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-title h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }

.panel-toolbar { margin-bottom: 1.5rem; }
.panel-toolbar .search-box { max-width: 400px; }

/* ── Panel product list ── */
.panel-product-list { display: flex; flex-direction: column; gap: .8rem; }
.panel-product-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color .2s;
}
.panel-product-item:hover { border-color: var(--primary); }
.panel-product-img {
  width: 64px; height: 64px; object-fit: contain;
  border-radius: 8px; background: var(--bg3); flex-shrink: 0; padding: .3rem;
}
.panel-product-info { flex: 1; min-width: 0; }
.panel-product-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-product-meta { font-size: .78rem; color: var(--text-light); margin-top: .3rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.panel-product-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.stock-input {
  width: 80px; padding: .4rem .6rem;
  border: 1px solid var(--border); border-radius: 6px;
  text-align: center; font-size: .95rem; font-weight: 600;
  background: var(--bg3); color: var(--text);
}
.stock-input:focus { outline: none; border-color: var(--primary); }
.btn-save-stock {
  background: var(--success); color: #fff;
  padding: .4rem .8rem; border-radius: 6px;
  font-size: .8rem; font-weight: 600;
  transition: background .2s;
}
.btn-save-stock:hover { background: #22a244; }
.btn-edit-full {
  background: var(--primary); color: #fff;
  padding: .4rem .8rem; border-radius: 6px;
  font-size: .8rem; font-weight: 600;
}

/* ── Tablas ── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.data-table th { background: var(--bg3); padding: .75rem 1rem; text-align: left; font-size: .8rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }
.data-table td { padding: .75rem 1rem; border-top: 1px solid var(--border); font-size: .88rem; }
.data-table tr:hover td { background: var(--bg3); }
.change-positive { color: var(--success); font-weight: 700; }
.change-negative { color: var(--danger); font-weight: 700; }

/* ── Roles ── */
.role-badge { display: inline-block; padding: .2rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.role-admin { background: rgba(255,214,10,0.15); color: var(--gold); }
.role-worker { background: rgba(52,131,250,0.15); color: #3483FA; }

/* ── MELI connect ── */
.meli-connect-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 2.5rem;
  max-width: 480px; text-align: center;
}
.meli-logo { height: 36px; object-fit: contain; margin-bottom: 1.5rem; filter: brightness(0) invert(1); opacity: .7; }
.meli-help { font-size: .82rem; color: var(--text-light); margin-top: .5rem; line-height: 1.6; }

/* ── Edit modal form ── */
.edit-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.quantity-controls { display: flex; align-items: center; gap: .5rem; }
.qty-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 1.2rem; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); }
.qty-input {
  width: 80px; text-align: center; font-size: 1.2rem; font-weight: 700;
  padding: .4rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg3); color: var(--text);
}

/* ── Sync indicator ── */
.sync-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

/* ── Footer ── */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 3rem 4rem 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem; margin-bottom: 2rem;
}
.footer-brand i { color: var(--primary); font-size: 1.8rem; }
.footer-brand h3 { font-size: 1.2rem; font-weight: 800; margin: .5rem 0; }
.footer-brand p { color: var(--text-light); font-size: .85rem; line-height: 1.6; max-width: 280px; }
.footer-col h4 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 1rem; }
.footer-col a { display: block; color: var(--text-light); font-size: .85rem; margin-bottom: .5rem; transition: color .2s; }
.footer-col a:hover { color: var(--primary); }
.footer-info { display: block; color: var(--text-light); font-size: .85rem; margin-bottom: .5rem; }
.footer-col a i, .footer-info i { color: var(--primary); width: 16px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--text-light); font-size: .8rem; }
.footer-meli { display: flex; align-items: center; gap: .5rem; color: var(--text-light); font-size: .8rem; }
.footer-meli i { color: var(--gold); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-content h1 { font-size: 3rem; }
  .section, .container { padding: 2.5rem; }
  .catalog-toolbar, .page-header { padding: 1.5rem 2.5rem; }
  .features { padding: 0 2.5rem 2.5rem; }
  .footer { padding: 2rem 2.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1.5rem; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: .6rem; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-brand { font-size: 1.2rem; }
  .nav-brand .brand-logo { height: 34px; }
  .nav-links .nav-link { width: 100%; padding: .8rem 1rem; border-radius: 8px; }
  .nav-links .btn-worker { margin-top: .3rem; justify-content: center; }
  .nav-account { width: 100%; }
  .nav-account .account-chip { width: 100%; justify-content: flex-start; }
  .account-menu { position: static; box-shadow: none; border: 1px solid var(--border); margin-top: .3rem; }
  .hero { min-height: auto; }
  .hero-content { padding: 3rem 1.5rem; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-vinyl { display: none; }
  .hero-stats { gap: 1.5rem; margin-top: 2rem; padding-top: 1.2rem; }
  .features { padding: 0 1.5rem 2rem; }
  .section { padding: 2rem 1.5rem; }
  .catalog-toolbar { padding: 1rem 1.5rem; }
  .container { padding: 1.5rem; }
  .page-header { padding: 1.5rem; }
  .footer { padding: 2rem 1.5rem; }
  /* Marca centrada arriba (ocupa el ancho completo) y debajo las 2 columnas lado a lado */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
  .footer-brand { grid-column: 1 / -1; text-align: center; }
  .footer-brand .brand-logo { margin-left: auto; margin-right: auto; }
  .footer-brand p { margin-left: auto; margin-right: auto; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .panel-main { margin-left: 0; }
  .panel-product-item { flex-wrap: wrap; }
  .panel-product-actions { width: 100%; justify-content: flex-end; }
}

.btn-add-cart .lbl-short { display: none; }
.btn-add-cart { white-space: nowrap; }

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .hero-content h1 { font-size: 1.9rem; }
  /* Botón de carrito compacto en tarjetas chicas: ícono + "Agregar" */
  .btn-add-cart { font-size: .8rem; padding: .5rem .4rem; gap: .35rem; }
  .btn-add-cart .lbl-full { display: none; }
  .btn-add-cart .lbl-short { display: inline; }
  .product-card-body { padding: .7rem; }
  .product-card-price { font-size: 1.05rem; }
}

/* ─── Carrito / Checkout ──────────────────────────────────────────────── */

.status-badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 999px;
}
.status-active { background: rgba(45,198,83,0.15); color: var(--success); }
.status-paused { background: rgba(244,162,97,0.15); color: var(--warning); }

.cart-link { position: relative; }
.cart-badge {
  display: none;
  align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; margin-left: .35rem;
}

.badge-new {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--gold); color: #1a1a1a;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px; letter-spacing: .5px;
}

.checkout-container { max-width: 1100px; margin: 0 auto; }

.cart-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem;
}
.cart-item img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
  font-size: .9rem; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item-price { color: var(--text-light); font-size: .85rem; margin-top: .2rem; }
.cart-item-qty { display: flex; align-items: center; gap: .5rem; }
.cart-item-qty button {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.cart-item-qty button:disabled { opacity: .4; cursor: not-allowed; }
.cart-item-qty span { min-width: 24px; text-align: center; font-weight: 700; }
.cart-item-subtotal { font-weight: 700; min-width: 100px; text-align: right; }
.cart-item-remove {
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem;
  padding: .5rem;
}

.checkout-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; max-width: 400px; margin-left: auto;
}
.checkout-summary-row {
  display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem;
}
.checkout-total {
  border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .8rem;
  font-size: 1.1rem; font-weight: 800;
}

.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: start; }
.checkout-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.checkout-form-card h3 { margin-bottom: 1rem; font-size: 1.05rem; }
.checkout-form-card h3 i { color: var(--primary); margin-right: .4rem; }

.payment-options { display: flex; flex-direction: column; gap: .8rem; }
.payment-option { cursor: pointer; }
.payment-option input { display: none; }
.payment-option-body {
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; transition: border-color .15s, background .15s;
}
.payment-option-body i { font-size: 1.5rem; color: var(--accent); width: 30px; text-align: center; }
.payment-option-body p { color: var(--text-light); font-size: .8rem; margin-top: .1rem; }
.payment-option input:checked + .payment-option-body {
  border-color: var(--primary); background: rgba(230,57,70,0.08);
}

.transfer-info {
  margin-top: 1rem; padding: 1rem; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid var(--border);
}
.transfer-info h4 { margin-bottom: .6rem; font-size: .9rem; }
.transfer-info h4 i { color: var(--accent); margin-right: .35rem; }
.bank-data-row {
  display: flex; justify-content: space-between; padding: .3rem 0; font-size: .9rem;
  border-bottom: 1px dashed var(--border);
}
.bank-data-row:last-child { border-bottom: none; }
.transfer-note { margin-top: .6rem; font-size: .8rem; color: var(--text-light); }

/* Pantalla de espera (envío solicitado) */
.espera-spinner {
  width: 74px; height: 74px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(230,57,70,0.12); color: var(--primary); font-size: 2rem;
  animation: espera-pulse 1.6s ease-in-out infinite;
}
@keyframes espera-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230,57,70,0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(230,57,70,0); }
}

/* Botones de método de pago (página pagar) */
.pay-method-btn {
  display: flex; align-items: center; gap: 1rem; text-align: left; width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 1rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pay-method-btn:hover { border-color: var(--primary); background: rgba(230,57,70,0.06); }
.pay-method-btn i { font-size: 1.5rem; color: var(--accent); width: 30px; text-align: center; }
.pay-method-btn p { color: var(--text-light); font-size: .82rem; margin-top: .1rem; }

@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .cart-item { flex-wrap: wrap; }
  .cart-item-subtotal { text-align: left; }
}

/* ─── Cuenta cliente (Google) ─────────────────────────────────────────────── */
.nav-account { position: relative; display: flex; align-items: center; }
.account-chip {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  padding: .35rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.account-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.account-chip i.fa-user-circle { font-size: 1.3rem; color: var(--text-light); }
.account-menu {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 190px; overflow: hidden;
}
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .7rem 1rem; font-size: .88rem; color: var(--text);
  background: none; border: none; cursor: pointer; text-align: left; text-decoration: none;
}
.account-menu a:hover, .account-menu button:hover { background: var(--bg3); }
.account-menu i { width: 16px; color: var(--text-light); }
.checkout-account { margin-bottom: 1rem; }

.nav-login-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--primary); color: #fff; text-decoration: none;
  font-weight: 600; font-size: .88rem;
  padding: .5rem 1.1rem; border-radius: 999px;
  transition: background .15s;
}
.nav-login-btn:hover { background: var(--primary-dark); }

/* ─── Paginación ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: .4rem; padding: 1.5rem 0 2.5rem; flex-wrap: wrap;
}
.page-btn {
  min-width: 38px; height: 38px; padding: 0 .6rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: default; }
.page-dots { color: var(--text-light); padding: 0 .2rem; }

.panel-toolbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.panel-select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .65rem .8rem; font-size: .9rem;
}

#whatsapp-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 999;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform .15s, box-shadow .15s;
  animation: wa-pulse 2.5s infinite;
}
#whatsapp-fab:hover { transform: scale(1.1); box-shadow: 0 6px 22px rgba(37,211,102,0.5); }
@keyframes wa-pulse {
  0% { box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 0 rgba(37,211,102,0.5); }
  70% { box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 0 rgba(37,211,102,0); }
}
@media (max-width: 480px) {
  #whatsapp-fab { width: 52px; height: 52px; font-size: 1.7rem; right: 16px; bottom: 16px; }
}

/* ─── Línea de tiempo de seguimiento ──────────────────────────────────────── */
.track-timeline { margin-top: 1.2rem; padding-left: .5rem; }
.track-step { display: flex; gap: 1rem; position: relative; padding-bottom: 1.4rem; }
.track-step:not(:last-child)::before {
  content: ''; position: absolute; left: 17px; top: 34px; bottom: 0;
  width: 2px; background: var(--border);
}
.track-step.done:not(:last-child)::before { background: var(--success); }
.track-dot {
  width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 2px solid var(--border); color: var(--text-light);
  font-size: .85rem; z-index: 1;
}
.track-step.done .track-dot { background: var(--success); border-color: var(--success); color: #fff; }
.track-step.active .track-dot {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px rgba(230,57,70,0.2);
}
.track-info { display: flex; flex-direction: column; gap: .15rem; padding-top: .3rem; }
.track-info strong { font-size: .92rem; }
.track-step:not(.done) .track-info strong { color: var(--text-light); font-weight: 600; }
.track-info span { font-size: .78rem; color: var(--text-light); }
.track-code { color: var(--accent) !important; }
.track-link {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .4rem;
  font-size: .82rem; font-weight: 600; color: var(--primary); text-decoration: none;
  border: 1px solid var(--primary); border-radius: 8px; padding: .35rem .7rem; width: fit-content;
  transition: background .15s, color .15s;
}
.track-link:hover { background: var(--primary); color: #fff; }

/* ─── Lista de deseados ───────────────────────────────────────────────────── */
.wish-badge { background: var(--gold); color: #1a1a1a; }

.wish-heart {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: none; cursor: pointer;
  color: #fff; font-size: .95rem; display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
}
.wish-heart:hover { transform: scale(1.12); background: rgba(0,0,0,0.75); }
.wish-heart.active { color: var(--primary); }

.wish-hint {
  font-size: .8rem; color: var(--accent); margin-top: .3rem;
  display: flex; align-items: center; gap: .4rem;
}

.wishlist-grid { display: flex; flex-direction: column; gap: 1rem; }
.wishlist-item {
  position: relative; display: flex; align-items: center; gap: 1.2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.wishlist-item.is-back { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.back-badge {
  position: absolute; top: -10px; left: 16px;
  background: var(--success); color: #fff; font-size: .72rem; font-weight: 700;
  padding: .2rem .7rem; border-radius: 999px;
}
.wishlist-thumb img { width: 80px; height: 80px; object-fit: contain; background: #fff; border-radius: 8px; }
.wishlist-info { flex: 1; min-width: 0; }
.wishlist-title {
  font-weight: 600; font-size: .95rem; color: var(--text); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wishlist-title:hover { color: var(--primary); }
.wishlist-price { font-size: 1.2rem; font-weight: 800; margin: .3rem 0; }
.wishlist-actions { display: flex; flex-direction: column; gap: .5rem; min-width: 180px; }
.wishlist-actions button { justify-content: center; }

@media (max-width: 640px) {
  .wishlist-item { flex-wrap: wrap; }
  .wishlist-actions { min-width: 100%; flex-direction: row; }
}

/* ─── Página de producto ──────────────────────────────────────────────────── */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.product-main-img {
  background: #fff; border-radius: var(--radius); padding: 1rem;
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1/1;
}
.product-main-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-thumbs { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.product-thumbs img {
  width: 60px; height: 60px; object-fit: contain; background: #fff;
  border-radius: 8px; padding: .25rem; cursor: pointer;
  border: 2px solid transparent; transition: border-color .15s;
}
.product-thumbs img.active, .product-thumbs img:hover { border-color: var(--primary); }

.product-condition { color: var(--text-light); font-size: .82rem; }
.product-title-lg { font-size: 1.6rem; font-weight: 800; line-height: 1.3; margin: .4rem 0 1rem; letter-spacing: -0.5px; }
.product-price-lg { font-size: 2.2rem; font-weight: 800; color: var(--text); }
.product-stock-lg { margin: .8rem 0 1.5rem; }
.product-actions { display: flex; flex-direction: column; gap: .8rem; max-width: 380px; }
.qty-selector { display: flex; align-items: center; gap: .8rem; }
.qty-selector button {
  width: 40px; height: 40px; border-radius: 8px; font-size: 1.2rem;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text); cursor: pointer;
}
.qty-selector input {
  width: 70px; text-align: center; font-size: 1.1rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .5rem;
}

.product-section { margin-top: 2.5rem; }
.product-section h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1rem; }
.product-section h2 i { color: var(--primary); margin-right: .4rem; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.specs-table td:first-child { color: var(--text-light); width: 40%; font-weight: 600; }
.specs-table tr:nth-child(odd) { background: var(--surface); }
.product-description { color: var(--text); line-height: 1.8; font-size: .95rem; white-space: pre-wrap; }

@media (max-width: 800px) {
  .product-page { grid-template-columns: 1fr; gap: 1.5rem; }
}

.spec-row { display: flex; gap: .5rem; margin-bottom: .5rem; }
.spec-row input { flex: 1; }
.spec-row .spec-name { max-width: 40%; }
.spec-row .btn-danger { padding: .5rem .7rem; }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.metrics-list { margin: 0; padding-left: 1.4rem; }
.metrics-list li {
  display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
  padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.metrics-list li:last-child { border-bottom: none; }
.metrics-list li a { color: var(--text); text-decoration: none; }
.metrics-list li a:hover { color: var(--primary); }
.metrics-list li span:last-child { font-weight: 800; color: var(--primary); }

.own-pic-thumb { position: relative; width: 64px; height: 64px; }
.own-pic-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #fff; }
.own-pic-thumb button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none; cursor: pointer; font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Gestión de envío (panel) ────────────────────────────────────────────── */
.shipping-box {
  margin-top: .9rem; padding: .9rem; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid var(--border);
}
.shipping-controls { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.shipping-controls select, .shipping-controls input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; flex: 1; min-width: 120px;
}
