/* ============================================
   Sneaker Shop - styles.css
   Estilos generales del layout y del catálogo
   ============================================ */

:root {
  --color-dark: #16151a;
  --color-dark-soft: #201f26;
  --color-purple-1: #b9a9e6;
  --color-purple-2: #d9c9ec;
  --color-text: #1c1b1f;
  --color-muted: #706e78;
  --color-border: #e7e5ea;
  --color-bg: #f6f5f8;
  --color-card: #ffffff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --font-main: "Poppins", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-dark);
  color: #fff;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Marca "STOCKED": replica .navbar-brand.fw-bold del admin (_Layout.cshtml, Bootstrap)
   sin cargar Bootstrap. Color blanco en vez de negro por el fondo oscuro del header. */
.brand {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.3125rem 0;
  white-space: nowrap;
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  background: #fff;
  color: var(--color-dark);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
}

.nav-link.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--color-purple-1), var(--color-purple-2));
  overflow: hidden;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.hero-copy {
  text-align: center;
}

.hero-eyebrow {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.hero-title {
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  margin: 0 0 8px;
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px;
}

.hero-tag {
  font-size: 14px;
  font-weight: 500;
  color: #2c2933;
  margin: 0;
}

/* ---------- Filtros / búsqueda ---------- */
.filters {
  background: var(--color-bg);
  padding: 28px 0 8px;
}

.search-box {
  max-width: 520px;
  margin: 0 auto 20px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 46px 12px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 14px;
}

.search-box button {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  width: 34px;
  border: none;
  border-radius: 50%;
  background: var(--color-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pill {
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
}

.category-pill.is-active {
  background: var(--color-dark);
  border-color: var(--color-dark);
  color: #fff;
}

/* ---------- Catálogo ---------- */
.catalog {
  padding: 24px 0 56px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.product-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 18px 18px 22px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(20, 18, 30, 0.06);
}

.product-media {
  aspect-ratio: 1 / 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.product-media img {
  max-height: 100%;
}

.product-name {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  margin: 0 0 10px;
  min-height: 30px;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 14px;
}

.btn-buy {
  width: 100%;
  border: none;
  background: var(--color-dark);
  color: #fff;
  padding: 10px 0;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.product-more {
  font-size: 12px;
  color: var(--color-muted);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #efeef2;
  border-top: 1px solid var(--color-border);
  padding-top: 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 28px;
}

.footer-col h4 {
  font-size: 13px;
  text-transform: none;
  font-weight: 600;
  margin: 0 0 14px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-muted);
}

.footer-col li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.badge-ssl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero .container {
    min-height: 200px;
    padding-top: 28px;
    padding-bottom: 28px;
  }
  .hero-title {
    font-size: 40px;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ============================================
   Catálogo dinámico (datos reales)
   Estados, badge Agotado, placeholder, paginación,
   botón de sesión y modal de detalle.
   ============================================ */

[hidden] {
  display: none !important;
}

/* ---------- Botón de sesión en el header ---------- */
.nav-link.nav-session {
  background: var(--color-purple-1);
  color: var(--color-dark);
  font-weight: 600;
}

.nav-link.nav-session:hover {
  background: var(--color-purple-2);
}

/* ---------- Estados (cargando / vacío / error) ---------- */
.catalog-status {
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
  margin: 8px 0 24px;
}

.catalog-status.is-error {
  color: #b3261e;
}

.product-grid.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ---------- Card: imagen, placeholder y agotado ---------- */
.product-media {
  position: relative;
  cursor: pointer;
}

.product-media img {
  max-height: 100%;
  object-fit: contain;
}

.product-media img.is-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
}

.product-badge-soldout {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.product-card.is-soldout .product-media img {
  opacity: 0.55;
}

/* ---------- Paginación ---------- */
.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.catalog-pagination-info {
  font-size: 13px;
  color: var(--color-muted);
}

.catalog-pagination .category-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Modal de detalle ---------- */
body.modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 21, 26, 0.6);
}

.product-modal-dialog {
  position: relative;
  background: var(--color-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 860px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 12px 40px rgba(20, 18, 30, 0.25);
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 22px;
  line-height: 1;
}

.product-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}

.product-modal-image {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-modal-image img {
  max-height: 100%;
  object-fit: contain;
}

.product-modal-image img.is-placeholder {
  width: 100%;
  height: 100%;
}

.product-modal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.product-modal-thumb {
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-thumb img {
  max-height: 100%;
  object-fit: contain;
}

.product-modal-thumb.is-active {
  border-color: var(--color-dark);
  box-shadow: 0 0 0 1px var(--color-dark);
}

.product-modal-category {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 8px 0 6px;
}

.product-modal-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
}

.product-modal-stock {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  margin: 0 0 20px;
}

.product-modal-stock.is-soldout {
  color: #fff;
  background: var(--color-dark);
}

@media (max-width: 700px) {
  .product-modal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product-modal-dialog {
    padding: 24px 18px;
  }
}

@media (max-width: 560px) {
  .site-header .container {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .main-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
}
