/* ========================================================================== */
/*  PROCO — UI BASE
    0) Reset / Variables / Utilidades
    1) Layout general (body, contenedores, footer)
    2) Topbar / Navegación
    3) Componentes comunes (botones, tags, tablas, cards, vacíos)
    4) Formularios / Secciones de formulario
    5) Login
    6) Catálogo (product cards)
    7) Carrito
    8) Panel Admin
    9) Panel Vendedor
    10) Responsivo
/* ========================================================================== */


/* ===== 0) RESET / VARIABLES / UTILIDADES ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f172a;               /* fondo base oscuro elegante */
  --bg-alt: #020617;           /* fondo más oscuro */
  --card: #0b1220;             /* tarjetas */
  --card-soft: #111827;

  --primary: #2563eb;          /* azul corporativo */
  --primary-soft: rgba(37, 99, 235, 0.2);
  --primary-strong: #1d4ed8;

  --accent: #22c55e;           /* acento verde (saldo OK) */
  --danger: #ef4444;
  --warning: #f97316;
  --muted: #9ca3af;

  --border-subtle: rgba(148, 163, 184, 0.35);

  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --text-strong: #f9fafb;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.85);

  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.22s ease;
}

html,
body {
  height: 100%;
}

body.app-body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
}

/* Utilidades */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}


/* ===== 1) LAYOUT GENERAL ===== */

.layout-main {
  min-height: calc(100vh - 64px - 56px); /* topbar y footer */
  padding-top: 4.5rem;
}

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.85rem 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-right {
  opacity: 0.7;
}


/* ===== 2) TOPBAR / NAV ===== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #38bdf8, #2563eb, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
  font-size: 1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, 0.45);
  margin: 0 0.3rem;
}

.nav-link {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft);
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.nav-link-accent {
  background: var(--primary);
  color: white;
  font-weight: 500;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.55);
}

.nav-link-accent:hover {
  background: var(--primary-strong);
  color: white;
}

.nav-user {
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--muted);
}

/* Botón menú móvil */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}


/* ===== FLASH MESSAGES ===== */

.flash-area {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  border: 1px solid transparent;
  margin-bottom: 0.4rem;
}

.flash-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.8);
  color: #bbf7d0;
}

.flash-danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(239, 68, 68, 0.8);
  color: #fecaca;
}

.flash-warning {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.8);
  color: #fed7aa;
}

.flash-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.9);
  color: #bfdbfe;
}


/* ===== 3) COMPONENTES COMUNES ===== */

/* Botones */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-disabled,
.btn-link,
.btn-link-danger,
.btn-ghost,
.btn-ghost-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-normal),
    border-color var(--transition-normal),
    color var(--transition-normal),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  text-decoration: none;
  gap: 0.35rem;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.65);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.55);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-strong);
}

.btn-disabled {
  background: rgba(55, 65, 81, 0.7);
  border-color: rgba(75, 85, 99, 0.8);
  color: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary,
.btn-ghost,
.btn-disabled {
  box-shadow: none;
}

.btn-link,
.btn-link-danger {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  padding: 0.2rem 0.1rem;
  color: var(--primary);
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link-danger {
  color: var(--danger);
}

.btn-link-danger:hover {
  text-decoration: underline;
}

.btn-ghost-alt {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text);
}

.full-width {
  width: 100%;
}

/* Tag / Badges */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: var(--text-soft);
}

.tag-muted {
  opacity: 0.6;
}

/* Tablas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.table th,
.table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-weight: 500;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.9);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.table tr:hover td {
  background: rgba(15, 23, 42, 0.8);
}

/* Cards genéricas */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-card,
.form-card {
  background: radial-gradient(circle at top left, #111827 0, #020617 60%);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  box-shadow: var(--shadow-soft);
}

.admin-card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.admin-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(75, 85, 99, 0.7);
  background: rgba(15, 23, 42, 0.75);
}

.empty-state.small {
  padding: 1.2rem 1rem;
  font-size: 0.85rem;
}

.empty-state h2,
.empty-state h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Inline form */
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.inline-form input[type="number"],
.inline-form select {
  max-width: 110px;
}


/* ===== 4) FORMULARIOS ===== */

.form-section {
  margin-top: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-md);
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.55);
  background: rgba(15, 23, 42, 0.98);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}


/* ===== 5) LOGIN ===== */

.login-wrapper {
  min-height: calc(100vh - 64px - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 1.6rem 1.5rem 1.8rem;
  border-radius: 24px;
  background: radial-gradient(circle at top, #111827 0, #020617 65%);
  border: 1px solid rgba(51, 65, 85, 0.95);
  box-shadow: var(--shadow-soft);
}

.login-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.login-footer-link {
  text-align: center;
  margin-top: 0.5rem;
}

.login-footer-link a {
  font-size: 0.8rem;
  color: var(--primary);
}

.login-footer-link a:hover {
  text-decoration: underline;
}


/* ===== 6) CATÁLOGO ===== */

.product-meta-line {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.product-variants {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.variant-chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-soft);
}


.catalog-hero {
  margin-bottom: 1.1rem;
}

.catalog-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.catalog-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.catalog-section {
  margin-top: 0.6rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* móvil: 2 columnas */
  gap: 0.8rem;
}

.product-card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(31, 41, 55, 0.95);
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.9);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.98);
  border-color: rgba(37, 99, 235, 0.65);
}

.product-image-wrapper {
  position: relative;
  padding: 0.55rem;
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%);
}

/* 🔧 AQUÍ EL AJUSTE CLAVE */
.product-image {
  border-radius: var(--radius-md);
  width: 100%;
  height: auto;           /* antes 160px fijo */
  object-fit: cover;
  background: #020617;
}

/* altura fija SOLO en el grid del catálogo */
.product-grid .product-image {
  height: 160px;
}

.product-image.placeholder {
  border-radius: var(--radius-md);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(55, 65, 81, 0.8);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Badge de estado — más contraste */
.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.85);
}

.product-badge-stock {
  background: #064e3b;              /* verde oscuro sólido */
  border-color: #22c55e;
  color: #bbf7d0;
}

.product-badge-out {
  background: #7f1d1d;              /* rojo oscuro sólido */
  border-color: #f97373;
  color: #fee2e2;
}

.product-badge-preorder {
  background: #78350f;              /* amarillo oscuro */
  border-color: #facc15;
  color: #fef9c3;
}


.product-body {
  padding: 0.7rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.product-description {
  font-size: 0.78rem;
  color: var(--text-soft);
  max-height: 3.3em;
  overflow: hidden;
}

.product-footer {
  margin-top: 0.35rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-amount {
  font-size: 0.95rem;
  font-weight: 600;
}

.price-currency {
  font-size: 0.7rem;
  color: var(--muted);
}

.product-action {
  display: flex;
}

.product-note {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}


/* ===== 7) CARRITO ===== */

.cart-section {
  margin-top: 0.5rem;
}

.cart-title {
  font-size: 1.4rem;
  margin-bottom: 0.15rem;
}

.cart-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 1rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cart-item-card {
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cart-item-main {
  display: flex;
  gap: 0.75rem;
}

.cart-item-image-wrapper {
  width: 86px;
  flex-shrink: 0;
}

.cart-item-image {
  border-radius: var(--radius-md);
  width: 100%;
  height: 70px;
  object-fit: cover;
}

.cart-item-image.placeholder {
  border-radius: var(--radius-md);
  height: 70px;
  border: 1px dashed rgba(75, 85, 99, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.cart-item-description {
  font-size: 0.75rem;
  color: var(--muted);
  max-height: 2.6em;
  overflow: hidden;
}

.cart-item-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.cart-item-meta span {
  color: var(--muted);
}

.cart-item-meta strong {
  color: var(--text);
}

.cart-item-actions {
  display: flex;
  justify-content: flex-end;
}

/* Resumen carrito */
.cart-summary {
  position: sticky;
  top: 5.4rem;
}

.cart-summary-card {
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.cart-summary-title {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.cart-summary-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 0.8rem;
}

.cart-back-link {
  margin-top: 0.4rem;
  justify-content: center;
}


/* ===== 8) PANEL ADMIN ===== */

.admin-section {
  margin-top: 0.5rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr);
  gap: 0.9rem;
}

.admin-card-full {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}


/* ===== 9) PANEL VENDEDOR ===== */

.vendor-section {
  margin-top: 0.5rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-soft);
}

.summary-label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 0.3rem;
}

.summary-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.12rem;
}

.summary-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.vendor-orders {
  margin-top: 0.4rem;
}


/* ===== 10) RESPONSIVE ===== */

@media (max-width: 960px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-summary {
    position: static;
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .section-actions .btn-primary,
  .section-actions .btn-secondary,
  .section-actions .btn-ghost {
    width: auto;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding-inline: 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    padding: 0.5rem 1.25rem 0.85rem;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(30, 64, 175, 0.7);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
  }

  .nav-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .nav-link,
  .nav-link-accent {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-divider {
    display: none;
  }

  .container {
    padding-inline: 1rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* se mantiene 2 */
  }

  .cart-item-main {
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  /* 🔧 altura solo en el grid, NO en el detalle */
  .product-grid .product-image {
    height: 190px;
  }

  .product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* desktop: 5 columnas */
  }

  .layout-main {
    padding-top: 4.7rem;
  }
}

/* Tarjeta de producto: estructura general */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 1.5rem;
  padding: 0.9rem;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), #020617);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

/* Contenedor de la imagen */
.product-media {
  position: relative;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #020617;
}

/* Footer: precio + botones, bien compacto */
.product-footer {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(30, 64, 175, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Línea del precio */
.product-price-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.product-price {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Bloque de botones */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Botones a ancho completo en la tarjeta */
.btn-full {
  width: 100%;
}

/* Botón deshabilitado (cuando no hay login o está agotado) */
.btn-disabled {
  opacity: 0.8;
  cursor: not-allowed;
  font-size: 0.8rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.95);
}

/* Botón ghost debajo del deshabilitado (Iniciar sesión) */
.product-actions .btn-ghost {
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-align: center;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.85);
}

.product-badge-stock {
  background: #064e3b;
  border-color: #22c55e;
  color: #bbf7d0;
}

.product-badge-out {
  background: #7f1d1d;
  border-color: #f97373;
  color: #fee2e2;
}

.product-badge-preorder {
  background: #78350f;
  border-color: #facc15;
  color: #fef9c3;
}

.product-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.product-link:hover .product-name {
  text-decoration: underline;
}

<style>
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(22px);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(15,23,42,0.85));
    border-bottom: 1px solid rgba(148,163,184,0.25);
  }

  .topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #e5e7eb;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 0.9rem;
    background: radial-gradient(circle at top left, #38bdf8, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(37,99,235,0.9);
  }

  .brand-text {
    font-weight: 600;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-link {
    font-size: 0.85rem;
    color: #cbd5f5;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 120ms ease, color 120ms ease;
  }

  .topbar-link:hover {
    background: rgba(15,23,42,0.9);
    color: #ffffff;
  }

  .topbar-link-logout {
    border: 1px solid rgba(248,113,113,0.7);
    color: #fecaca;
  }

  .topbar-link-logout:hover {
    background: rgba(248,113,113,0.16);
    color: #fee2e2;
  }

  .topbar-province-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: radial-gradient(circle at top left, rgba(59,130,246,0.3), rgba(15,23,42,0.9));
    border: 1px solid rgba(148,163,184,0.5);
    font-size: 0.78rem;
    box-shadow: 0 10px 28px rgba(15,23,42,0.9);
  }

  .topbar-province-chip .chip-label {
    color: #9ca3af;
    font-size: 0.76rem;
  }

  .topbar-province-chip .chip-value {
    font-weight: 600;
    color: #e5e7eb;
  }

  @media (max-width: 768px) {
    .topbar-inner {
      padding-inline: 0.75rem;
    }
    .topbar-actions {
      justify-content: flex-end;
    }
  }
</style>

.qty-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.qty-input {
  width: 70px;
  padding: 6px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
}

.qty-input:focus {
  outline: none;
  border-color: #0088ff;
  box-shadow: 0 0 0 2px rgba(0,136,255,0.2);
}

.qty-btn {
  padding: 6px 12px;
  background: #0088ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.qty-btn:hover {
  background: #006fd6;
}
