/* ============================================================
   css/tienda-premium.css — Catálogo Premium (Stuffius-style)
   Variables de marca: --store-primary / --store-secondary / --store-accent
   ============================================================ */

/* ── Catalog brand color variables (defaults, overridden by JS) ── */
:root {
  --store-primary:   #111111;
  --store-secondary: #555555;
  --store-accent:    #ffffff;
}

body.tienda-premium {
  background: #ffffff;
  color: #111111;
  font-family: var(--font);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

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

/* ── HEADER ──────────────────────────────────────────────── */
.p-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.p-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.p-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--store-primary, #111);
  flex-shrink: 0;
}

.p-logo-img {
  height: 60px;
  max-width: 260px;
  width: auto;
  object-fit: contain;
}

.p-logo-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--store-primary, #111);
}

.p-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.p-nav-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 200ms ease;
}
.p-nav-link:hover { color: var(--store-primary, #111); }

.p-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.p-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 200ms;
}
.p-search-btn:hover { color: #111; }

.p-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--store-primary, #111);
  color: #fff;
  border-radius: 50%;
  transition: opacity 200ms;
}
.p-wa-btn:hover { opacity: 0.8; color: #fff; }

/* Search bar slide-down */
.p-search-bar {
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  padding: 12px 24px;
}

.p-search-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 14px;
  color: #666;
}

.p-search-inner input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  color: #111;
}

.p-search-inner input::placeholder { color: #aaa; }

.p-search-inner button {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  padding: 2px;
}

/* ── HERO ────────────────────────────────────────────────── */
.p-hero {
  position: relative;
  height: 50vw;
  max-height: 520px;
  min-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.p-hero-img-wrap {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--store-primary,#111) 0%, var(--store-secondary,#333) 100%);
}

.p-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-hero-content {
  position: absolute;
  bottom: 120px;
  left: 0;
  right: 0;
  padding: 0 32px;
  z-index: 2;
}

.p-hero-title {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #fff;
  line-height: 1;
  mix-blend-mode: overlay;
  opacity: 0.95;
  pointer-events: none;
  user-select: none;
}

/* Hero search overlay */
.p-hero-search {
  position: relative;
  z-index: 3;
  padding: 20px 24px 28px;
  background: linear-gradient(to top, rgba(255,255,255,0.15) 0%, transparent 100%);
}

.p-hero-search-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 10px 10px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.p-hero-search-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

.p-hero-search-box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  border-left: 1px solid rgba(0,0,0,0.1);
  padding-left: 14px;
}

.p-hero-search-box input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  color: #111;
}

.p-hero-search-box input::placeholder { color: #aaa; }

.p-hero-search-btn {
  background: var(--store-primary, #111);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 20px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 200ms;
  white-space: nowrap;
}
.p-hero-search-btn:hover { opacity: 0.85; }

@media (max-width: 600px) {
  .p-hero-search-inner {
    padding: 8px 8px 8px 12px;
    gap: 8px;
  }
  .p-hero-search-label {
    display: none;
  }
  .p-hero-search-box {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .p-hero {
    height: 70vw;
    min-height: 340px;
  }
  .p-hero-content {
    bottom: 95px;
    padding: 0 20px;
  }
  .p-hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .p-hero-search {
    padding: 16px 20px 20px;
  }
}

/* ── CATEGORY TABS ───────────────────────────────────────── */
.p-cats-wrap {
  border-bottom: 1px solid rgba(0,0,0,0.07);
  background: #fff;
  position: sticky;
  top: 80px;
  z-index: 80;
}

.p-cats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  overflow: hidden;
}

.p-cats {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.p-cats::-webkit-scrollbar { display: none; }

.p-cat {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  color: var(--store-secondary, #555);
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
  font-family: var(--font);
}
.p-cat:hover { color: var(--store-primary, #111); border-color: var(--store-primary, #111); }
.p-cat.active {
  background: var(--store-primary, #111);
  color: #fff;
  border-color: var(--store-primary, #111);
}

/* ── PRODUCT GRID ────────────────────────────────────────── */
.p-grid-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

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

@media (min-width: 600px) {
  .p-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .p-grid { grid-template-columns: repeat(4, 1fr); }
}

.p-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.p-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.p-card.p-card-oos-wrap { opacity: 0.65; }

.p-card-img-wrap {
  position: relative;
  padding-bottom: 100%;
  background: #f8f8f8;
  overflow: hidden;
}
.p-card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.p-card:hover .p-card-img-wrap img { transform: scale(1.04); }

.p-card-img-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
}

.p-card-oos {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-card-oos span {
  background: rgba(255,255,255,0.9);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.p-card-body { padding: 12px; }

.p-card-cat {
  font-size: 9px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.p-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p-card-desc {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.p-card-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111;
}

.p-card-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--store-primary, #111);
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 200ms, color 200ms;
  flex-shrink: 0;
}
.p-card-btn:hover { background: var(--store-secondary, #555); color: #fff; }

.p-card-btn.disabled {
  background: #ddd;
  color: #aaa;
  pointer-events: none;
}

.p-no-results {
  grid-column: 1 / -1;
  padding: 80px 20px;
  text-align: center;
  color: #aaa;
  font-size: 0.875rem;
}

/* ── RECOMMENDED SECTION ─────────────────────────────────── */
.p-recs {
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 48px 0;
  background: #fff;
}

.p-recs-head {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.p-recs-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.03em;
}

.p-recs-arrows {
  display: flex;
  gap: 8px;
}

.p-arr {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms;
  color: #111;
}
.p-arr:hover { background: #111; color: #fff; border-color: #111; }

.p-recs-track-wrap {
  padding: 0 24px;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

.p-recs-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.p-recs-track::-webkit-scrollbar { display: none; }

.p-rec-card {
  flex-shrink: 0;
  width: 220px;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: box-shadow 200ms ease;
  background: #fff;
}
.p-rec-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.p-rec-img {
  height: 180px;
  background: #f8f8f8;
  overflow: hidden;
}
.p-rec-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.p-rec-card:hover .p-rec-img img { transform: scale(1.04); }

.p-rec-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
}

.p-rec-body { padding: 12px; }

.p-rec-cat {
  font-size: 9px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.p-rec-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p-rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.p-rec-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111;
}
.p-rec-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--store-primary, #111);
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 200ms, color 200ms;
}
.p-rec-btn:hover { background: var(--store-secondary, #555); color: #fff; }

/* ── CTA BANNER ──────────────────────────────────────────── */
.p-cta {
  background: linear-gradient(135deg, var(--store-primary, #111) 0%, var(--store-secondary, #333) 100%);
  color: #fff;
  padding: 60px 24px;
  margin: 0;
}

.p-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.p-cta-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.p-cta-sub {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
  max-width: 360px;
}

.p-cta-form { display: flex; gap: 10px; flex-wrap: wrap; }

.p-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: var(--store-accent, #fff);
  color: var(--store-primary, #111);
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 200ms, color 200ms, opacity 200ms;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.p-cta-btn:hover { opacity: 0.95; color: var(--store-secondary, #333); }

.p-cta-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 768px) {
  .p-cta-inner { grid-template-columns: 1fr; }
  .p-cta-right { display: none; }
}

/* ── FOOTER ──────────────────────────────────────────────── */
.p-footer {
  margin-top: auto;
  background: #111;
  color: rgba(255,255,255,0.85);
  padding: 60px 24px 32px;
}

.p-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.p-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .p-footer-cols {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .p-footer-brand-desc {
    margin: 0 auto;
  }
}

.p-footer-brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 8px;
}

.p-footer-brand-desc {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 240px;
}


.p-footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}

.p-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-footer-links a {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 200ms;
}
.p-footer-links a:hover { color: var(--store-secondary, #fff); }

.p-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.p-footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

.p-footer-powered {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 200ms;
}
.p-footer-powered:hover { color: rgba(255,255,255,0.6); }
.p-footer-powered strong { font-weight: 700; }

/* ── DRAWER BASE STRUCTURE ─────────────────────────────────── */
body.tienda-premium .detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.tienda-premium .detail-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.tienda-premium .drawer-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 84px;
}

body.tienda-premium .drawer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
  z-index: 10;
}

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

body.tienda-premium .drawer-handle {
  width: 32px;
  height: 3px;
  border-radius: 1.5px;
  margin: 10px auto 0;
}

/* ── DRAWER (light mode) ─────────────────────────────────── */
body.tienda-premium .detail-overlay {
  background: rgba(0,0,0,0.5);
}

body.tienda-premium .detail-drawer {
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px 16px 0 0;
  color: #111;
  overflow: hidden;
}

body.tienda-premium .drawer-handle {
  background: rgba(0,0,0,0.1);
}

body.tienda-premium .drawer-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

body.tienda-premium .drawer-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

@media (min-width: 900px) {
  body.tienda-premium .drawer-img,
  body.tienda-premium .drawer-img-placeholder {
    height: 320px;
  }
}

/* Variant Pills */
body.tienda-premium .drawer-variants-container {
  margin-top: 16px;
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

body.tienda-premium .drawer-variants-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--store-secondary, #777);
  margin-bottom: 10px;
}

body.tienda-premium .drawer-variants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.tienda-premium .variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fafafa;
  color: var(--store-secondary, #444);
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}
body.tienda-premium .variant-pill:hover {
  border-color: var(--store-primary, #111);
  color: var(--store-primary, #111);
  background: #f3f3f3;
}
body.tienda-premium .variant-pill.active {
  background: var(--store-primary, #111);
  color: #fff;
  border-color: var(--store-primary, #111);
}

body.tienda-premium .drawer-body { padding: 20px; }

body.tienda-premium .drawer-cat {
  font-size: 10px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

body.tienda-premium .drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

body.tienda-premium .drawer-desc {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

body.tienda-premium .drawer-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

body.tienda-premium .btn-wa-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--store-primary, #111);
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: opacity 200ms;
}
body.tienda-premium .btn-wa-full:hover { opacity: 0.85; }

@media (min-width: 900px) {
  body.tienda-premium .detail-drawer {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid rgba(0,0,0,0.08);
    transform: translateX(100%);
    max-height: none;
  }
  body.tienda-premium .detail-drawer.open { transform: translateX(0); }
  body.tienda-premium .drawer-handle { display: none; }
}

/* ── Loading state (light) ───────────────────────────────── */
body.tienda-premium .loading-state {
  background: #fff;
  color: #aaa;
}
body.tienda-premium .loading-state .spinner {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #333;
}

body.tienda-premium .store-error {
  background: #fff;
  color: #111;
}
