/* styles.css */

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-card: #020617;
  --bg-soft: #020617;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.2);
  --accent-strong: #22c55e;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --danger: #f97373;
  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.75);
  --radius-xl: 24px;
  --radius-pill: 999px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 50%, #000 100%);
  color: var(--text);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: radial-gradient(circle at top left, #0b1120 0, #020617 65%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(18px);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, #22c55e, #0ea5e9 45%, #0b1120);
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.4),
    0 0 40px rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1120;
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5e7eb;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 18px 80px;
}

.title {
  font-size: 1.9rem;
  margin: 10px 0 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Product list */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

/* Cards */
.card,
.product-card {
  background: radial-gradient(circle at top left, #020617 0, #020617 55%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Product card */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-image {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at top, #1f2937, #020617);
  cursor: zoom-in;
}

.product-image img {
  width: 100%;
  display: block;
  border-radius: inherit;
}

/* Badges */
.product-badges {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-main {
  border-color: rgba(56, 189, 248, 0.7);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.1),
    rgba(34, 197, 94, 0.15)
  );
}

/* Textos producto */
.product-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 4px 0 0;
}

.product-description {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.product-price {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Options (tallas, colores) */
.product-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.size-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.72rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

.size-pill.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Color dots */
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.3);
  cursor: pointer;
}

.color-dot.selected {
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.6),
    0 0 0 4px rgba(15, 23, 42, 0.9);
}

/* Inventory / etiquetas extra */
.product-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.product-stock {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Buttons card */
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-primary,
.btn-outline {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #020617;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.3),
    0 20px 40px rgba(45, 212, 191, 0.45);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.5);
}

/* Feedback section */
.feedback-section {
  margin-top: 24px;
}

.subtitle {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.feedback-form {
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: 16px;
}

label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  font-size: 0.82rem;
}

textarea {
  resize: vertical;
}

/* Carrito FAB */
.cart-fab {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 20;
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  background: radial-gradient(circle at top left, #22c55e, #0ea5e9);
  color: #020617;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 18px 40px rgba(34, 197, 94, 0.7);
}

/* Modal genérico */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.9);
  z-index: 30;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: min(520px, 92vw);
  max-height: 80vh;
  background: radial-gradient(circle at top left, #020617 0, #020617 55%);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header h2 {
  font-size: 1rem;
}

/* Icon button */
.icon-btn {
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* Cart */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}

.cart-item img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}

.cart-item-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.cart-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-qty button {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.cart-item-price {
  font-size: 0.78rem;
}

/* Cart footer */
.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 10px;
}

/* Full width button */
.full-width {
  width: 100%;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 0.8rem;
  z-index: 40;
}

/* Utilidades */
.mt {
  margin-top: 8px;
}

/* Admin hidden by default si existiera */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .product-list {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding-inline: 12px;
  }

  .modal-content {
    max-width: 100%;
  }
}

/* Modal overlay */
.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.image-overlay.visible {
  display: flex;
}

.modal-image {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 12px;
  transition: transform 0.25s ease;
}

/* Cuando el modal esté abierto, bloqueamos el scroll del fondo */
body.no-scroll {
  overflow: hidden;
}

/* Botones de navegación dentro del overlay (flechas) */
.image-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.image-nav-left {
  left: 8px;
}

.image-nav-right {
  right: 8px;
}
