/* ============================================================
   COFALOZA Regalería – Dark Luxury Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #090909;
  --bg-card:      #111111;
  --bg-card-hover:#161616;
  --bg-elevated:  #1a1a1a;
  --border:       #242424;
  --border-light: #2e2e2e;
  --gold:         #c9a84c;
  --gold-light:   #e4c97a;
  --gold-dim:     #8a6e2f;
  --text:         #e8e8e8;
  --text-muted:   #7a7a7a;
  --text-dim:     #4a4a4a;
  --white:        #ffffff;
  --danger:       #c94c4c;
  --success:      #4caf80;

  --font-display: 'Cormorant Garamond', serif;
  --font-body:    'Outfit', sans-serif;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 24px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 30px rgba(201,168,76,0.15);
  --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Header ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,9,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.logo-img {
  height: 48px;
  width: auto;
  mix-blend-mode: screen;
}

.logo-sep {
  width: 1px;
  height: 28px;
  background: var(--border-light);
}

.logo-sub {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  line-height: 1;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  flex-shrink: 0;
}
.header-phone:hover { color: var(--gold); }
.header-phone svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0d0d0d 0%, #111008 50%, #0d0d0d 100%);
  padding: 5rem 2rem 4rem;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 100%, rgba(201,168,76,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding: 0.35rem 1.2rem;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 100px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero p {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 300;
}

/* ── Search bar ─────────────────────────────────────────── */
.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 100px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--gold-light); }
.search-btn svg { width: 18px; height: 18px; }

/* ── Main layout ────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ── Sidebar / Categorías ───────────────────────────────── */
.sidebar {
  position: sticky;
  top: 96px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

.cat-list { display: flex; flex-direction: column; gap: 2px; }

.cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}
.cat-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.cat-btn.active {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.2);
  color: var(--gold);
}

.cat-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 100px;
}
.cat-btn.active .cat-count { color: var(--gold-dim); }

/* ── Products grid ──────────────────────────────────────── */
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.products-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.products-count strong {
  color: var(--gold);
  font-weight: 500;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ── Product card ───────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201,168,76,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.product-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-elevated);
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold);
  color: #000;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.product-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.product-no-img svg { width: 48px; height: 48px; opacity: 0.3; }

.product-body {
  padding: 1.25rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-cat {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--white);
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold);
}

.btn-consultar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-consultar:hover {
  background: rgba(37,211,102,0.1);
  border-color: rgba(37,211,102,0.3);
  color: #25d366;
}
.btn-consultar svg { width: 14px; height: 14px; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-state svg {
  width: 64px; height: 64px;
  opacity: 0.2;
  margin: 0 auto 1rem;
}
.empty-state p { font-size: 1rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 4rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WhatsApp float ─────────────────────────────────────── */
.wa-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: #25D366;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37,211,102,0.5);
}
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* ── Modal de detalle ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-img {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--bg-elevated);
}
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-img .product-no-img { height: 100%; }

.modal-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal-close svg { width: 16px; height: 16px; }

.modal-inner { position: relative; }

.modal-cat {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.modal-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--white);
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.modal-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--gold);
}

.btn-wa-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-wa-modal:hover { background: #1eb857; }
.btn-wa-modal svg { width: 20px; height: 20px; fill: #fff; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo { height: 36px; mix-blend-mode: screen; opacity: 0.6; }
.footer-text { font-size: 0.8rem; color: var(--text-dim); }
.footer-copy { font-size: 0.75rem; color: var(--text-dim); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar { position: static; }
  .cat-list { flex-direction: row; flex-wrap: wrap; }
  .cat-btn { width: auto; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-img { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 1rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .main { padding: 2rem 1rem 4rem; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .logo-sub { font-size: 1.05rem; }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ── Animations ──────────────────────────────────────────── */
.product-card {
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
