/* ============================================================
   css/tienda.css — Catálogo Público (Minimalista & Premium)
   ============================================================ */

body.tienda-page {
  background: var(--c-bg);
}

/* ─── Header público ─────────────────────────────────────── */
.store-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.store-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  max-width: 900px;
  margin: 0 auto;
}

.store-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--c-text);
}

.store-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-info { flex: 1; }

.store-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.store-powered {
  font-size: 9px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.store-powered span { color: var(--c-text); font-weight: 700; }

/* ─── Filtros ────────────────────────────────────────────── */
.store-filters {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 16px;
}

.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-md);
  color: var(--c-text);
  font-size: var(--text-sm);
  outline: none;
  transition: all var(--duration) var(--ease);
  font-family: var(--font);
}

.search-input::placeholder { color: rgba(255,255,255,0.25); }

.search-input:focus {
  border-color: var(--c-text);
  background: rgba(255,255,255,0.04);
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--c-border-2);
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  font-family: var(--font);
}

.category-tab:hover {
  color: var(--c-text);
  border-color: var(--c-text);
}

.category-tab.active {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}

/* ─── Grid de productos ──────────────────────────────────── */
.store-grid-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.store-product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--duration) var(--ease);
  cursor: pointer;
  position: relative;
}

.store-product-card:hover {
  border-color: var(--c-border-2);
}

.store-product-card.out-of-stock {
  opacity: 0.6;
}

.product-img-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: rgba(255,255,255,0.01);
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
}

.product-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted);
}

.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.out-of-stock-label {
  background: var(--c-border-2);
  color: var(--c-text);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-card-content { padding: 12px; }

.product-card-cat {
  font-size: 9px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.product-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-desc {
  font-size: var(--text-xs);
  color: var(--c-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.product-price {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text);
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  font-family: var(--font);
  flex-shrink: 0;
}

.btn-wa:hover {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}

.btn-wa.disabled {
  border-color: var(--c-border);
  color: var(--c-muted);
  cursor: not-allowed;
  background: transparent;
}

/* ─── Detail drawer (slide from bottom) ─────────────────── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease);
}

.detail-overlay.open {
  opacity: 1;
  visibility: visible;
}

.detail-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.detail-drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 32px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 1.5px;
  margin: 10px auto 0;
}

.drawer-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  margin-top: 10px;
  border-bottom: 1px solid var(--c-border);
}

.drawer-img-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.01);
  margin-top: 10px;
  border-bottom: 1px solid var(--c-border);
}

.drawer-body { padding: 20px; }

.drawer-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.drawer-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.drawer-desc {
  font-size: var(--text-sm);
  color: var(--c-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.drawer-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 20px;
}

.btn-wa-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: var(--c-text);
  color: var(--c-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-wa-full:hover { background: var(--c-violet-200); }
.btn-wa-full:disabled { background: var(--c-border-2); color: var(--c-muted); cursor: not-allowed; }

/* ─── Empty / Error ──────────────────────────────────────── */
.store-empty {
  text-align: center;
  padding: 80px 20px;
}

.store-error {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  gap: 16px;
}

/* ─── Footer ─────────────────────────────────────────────── */
.store-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 24px 16px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.store-footer a { color: var(--c-text); font-weight: 600; }

/* ─── No results ────────────────────────────────────────── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--c-muted);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (min-width: 600px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .store-header-inner { padding: 0 24px; }
  .store-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-drawer {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    max-height: 100%;
    width: 380px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    border-top: none;
    border-left: 1px solid var(--c-border-2);
    transform: translateX(100%);
    max-height: none;
  }
  .detail-drawer.open { transform: translateX(0); }
  .drawer-handle { display: none; }
}

/* ─── Store footer ────────────────────────────────────────── */
body.tienda-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#catalogContent {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.store-footer {
  margin-top: auto;
  border-top: 1px solid var(--c-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.store-footer a {
  color: var(--c-muted);
  font-size: var(--text-xs);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}

.store-footer a:hover {
  color: var(--c-text);
}

.store-footer-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--c-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.store-footer-cataloglink {
  color: var(--c-muted);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

.store-footer-cataloglink:hover {
  color: var(--c-text);
}

/* ─── WhatsApp Contact Link ──────────────────────────────── */
.store-contact-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 24px;
  padding: 0 16px;
}

.store-contact-link {
  color: var(--c-muted);
  font-size: var(--text-xs);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--duration) var(--ease);
}

.store-contact-link:hover {
  color: var(--c-text);
}



