/* ==========================================================================
   Purpura Joyeria - Frontend publico
   Paleta: acero/grafito (base) + plata (superficies) + acento purpura.
   Inspirado en undetalle.com.pe, adaptado a joyeria en acero.
   ========================================================================== */

:root {
  /* Base CLARA (estilo undetalle) */
  --c-bg: #ffffff;
  --c-bg-2: #faf7fe;
  --c-surface: #ffffff;
  --c-surface-2: #f5f1fb;
  --c-border: #ece7f4;

  /* Texto */
  --c-text: #1d1530;
  --c-text-soft: #5b5470;
  --c-text-muted: #8c84a0;

  /* Acero / plata (neutros claros) */
  --c-steel: #6b647e;
  --c-silver: #b7b0c6;

  /* Acento purpura (marca) */
  --c-accent: #7c3aed;
  --c-accent-2: #9333ea;
  --c-accent-soft: rgba(124, 58, 237, 0.10);

  /* Estados */
  --c-success: #16a34a;
  --c-danger: #dc2626;
  --c-sale: #db2777;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 34px rgba(91, 33, 182, 0.12);
  --shadow-soft: 0 4px 16px rgba(91, 33, 182, 0.08);
  --container: 1200px;
  --header-h: 64px;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.accent {
  color: var(--c-accent-2);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  background: var(--c-surface-2);
  color: var(--c-text);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.35);
}

.btn-ghost {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-text-soft);
}

.btn-ghost:hover {
  border-color: var(--c-steel);
  color: var(--c-text);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #8e5ba6;
  border-bottom: 0;
}

.header-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  grid-template-areas: "search logo actions";
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand .dot {
  color: var(--c-accent-2);
}

/* Buscador */
.search {
  grid-area: search;
  justify-self: start;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  max-width: 350px;
  min-width: 0;
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--c-text);
  font-size: 0.95rem;
  outline: none;
}

.search input::placeholder {
  color: var(--c-text-muted);
}

.search button {
  border: none;
  background: var(--c-accent);
  color: #fff;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Acciones (cuenta / carrito) */
.header-actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  color: var(--c-text);
  border-color: var(--c-steel);
}

.icon-btn .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.burger {
  display: none;
}

/* Nav de categorias */
.nav-cats {
  background: #6f4587;
  border-top: 0;
}

.nav-cats ul {
  display: flex;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-x: auto;
}

.nav-cats a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-cats a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ==========================================================================
   Carrito drawer
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 60;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--c-bg-2);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 70;
  display: flex;
  flex-direction: column;
}

#cart-toggle:checked ~ .drawer-overlay {
  opacity: 1;
  visibility: visible;
}

#cart-toggle:checked ~ .cart-drawer {
  transform: translateX(0);
}

.cart-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--c-border);
}

.cart-drawer header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.cart-close {
  cursor: pointer;
  color: var(--c-text-muted);
  font-size: 1.4rem;
  line-height: 1;
}

.cart-body {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px 20px;
  color: var(--c-text-muted);
}

.cart-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--c-border);
}

.cart-footer .btn {
  width: 100%;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(
      1100px 500px at 80% -10%,
      rgba(139, 92, 246, 0.18),
      transparent 60%
    ),
    linear-gradient(180deg, var(--c-bg-2), var(--c-bg));
  border-bottom: 1px solid var(--c-border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 72px 0;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-accent-2);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 18px;
}

.hero p {
  color: var(--c-text-soft);
  font-size: 1.08rem;
  max-width: 480px;
  margin-bottom: 26px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-art {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--c-surface), var(--c-surface-2));
  border: 1px solid var(--c-border);
  display: grid;
  place-items: center;
  color: var(--c-steel);
  font-family: var(--font-display);
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

/* ---------- Barra de confianza ---------- */
.trust-bar {
  background: var(--c-bg-2);
  border-bottom: 1px solid var(--c-border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 26px 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trust-item .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--c-accent-soft);
  color: var(--c-accent-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  font-size: 0.98rem;
}

.trust-item span {
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ==========================================================================
   Secciones / grids de producto
   ========================================================================== */
.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0;
}

.section-head a {
  color: var(--c-accent-2);
  font-size: 0.92rem;
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-steel);
  box-shadow: var(--shadow-soft);
}

.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--c-surface-2), var(--c-bg-2));
  display: grid;
  place-items: center;
  color: var(--c-steel);
  font-family: var(--font-display);
}

.product-thumb .sale-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--c-sale);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.product-info {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-cat {
  font-size: 0.74rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.product-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
}

.product-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

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

.product-price .old {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  text-decoration: line-through;
}

/* ---------- Compra por categoria ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cat-card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: linear-gradient(135deg, var(--c-surface), var(--c-surface-2));
  display: flex;
  align-items: flex-end;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s ease;
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-accent);
}

.cat-card span {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

/* ---------- Newsletter ---------- */
.newsletter {
  background: linear-gradient(135deg, var(--c-surface), var(--c-bg-2));
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 44px;
  text-align: center;
}

.newsletter h2 {
  margin-bottom: 10px;
}

.newsletter p {
  color: var(--c-text-soft);
  max-width: 480px;
  margin: 0 auto 22px;
}

.newsletter form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter input {
  flex: 1;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--c-text);
  outline: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--c-bg-2);
  border-top: 1px solid var(--c-border);
  margin-top: 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 50px 0 30px;
}

.footer-grid h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-silver);
  margin: 0 0 16px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-grid a {
  color: var(--c-text-muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}

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

.footer-about .brand {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.footer-about p {
  color: var(--c-text-muted);
  font-size: 0.92rem;
  max-width: 280px;
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.pay-chip {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
}

.socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.socials a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  display: grid;
  place-items: center;
  color: var(--c-text-soft);
  transition: color 0.2s, border-color 0.2s;
}

.socials a:hover {
  color: var(--c-accent-2);
  border-color: var(--c-accent);
}

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.libro-reclamaciones {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  color: var(--c-text-soft);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 48px 0;
  }
  .hero-art {
    order: -1;
    aspect-ratio: 16 / 10;
  }
  .burger {
    display: grid;
  }
  .header-top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "burger logo actions"
      "search search search";
  }
  .search {
    display: flex;
    max-width: none;
  }
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .section {
    padding: 40px 0;
  }
  .newsletter {
    padding: 30px 20px;
  }
  .newsletter form {
    flex-direction: column;
  }
  .newsletter input,
  .newsletter form .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cat-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== Tema claro: overrides estilo undetalle ===== */
body { background: var(--c-bg); color: var(--c-text); }
.site-header { background: #8e5ba6; border-bottom: 0; }
.nav-cats { background: #6f4587; border-top: 0; }
.nav-cats a { color: rgba(255,255,255,.9); }
.nav-cats a:hover { color: #fff; }
.topbar, .announce { background: var(--c-accent); color:#fff; }
.product-card { background:#fff; border:1px solid var(--c-border); box-shadow: var(--shadow-soft); }
.product-name { color: var(--c-text); }
.product-cat { color: var(--c-accent); }
.site-footer, footer.site-footer { background: linear-gradient(135deg,#4c1d95,#7c3aed); color:#fff; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color:#fff; }
.cart-drawer { background:#fff; color:var(--c-text); }
