/* ============================================================
   Opti Muebles — tokens
   Paleta oficial de marca (manual de marca Opti Muebles).
   ============================================================ */
:root {
  --bg: #FFFFFF;
  --bg-soft: #F4F9F2;
  --panel: #FBFDFA;
  --mint: #e0efdb;
  --ink: #4a494a;
  --ink-soft: #74736f;
  --teal: #69adac;
  --teal-dark: #4f8483;
  --slate: #546b79;
  --skyblue: #96c7de;
  --line: #E6E6E3;
  --line-strong: #c4c4c4;
  --white: #ffffff;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(74,73,74,.06), 0 4px 14px rgba(74,73,74,.07);
  --serif: "Poppins", "Century Gothic", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

button { font-family: var(--sans); cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.logo img { height: 38px; width: auto; display: block; }

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

.header-nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.header-nav a { text-decoration: none; color: var(--ink-soft); }
.header-nav a:hover { color: var(--ink); }

.cart-button {
  position: relative;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-count {
  background: var(--teal);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 0 5px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  max-width: 14ch;
}

.hero p.lead {
  font-size: 18px;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease;
}

.btn:active { transform: scale(.98); }

.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-dark); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--panel); }

.hero-art {
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art svg { width: 100%; height: auto; }

.hero-facts {
  display: flex;
  gap: 28px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-fact b {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--teal-dark);
}

.hero-fact span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Catálogo ---------- */

.catalog {
  padding: 40px 0 80px;
}

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

.catalog-head h2 { font-size: 30px; margin-bottom: 6px; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
}

.filter-chip.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-thumb {
  aspect-ratio: 1/1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-thumb .placeholder {
  width: 46%;
  color: var(--line-strong);
}

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

.product-cat {
  font-size: 12px;
  color: var(--teal-dark);
  font-weight: 600;
}

.product-name {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.product-medidas { font-size: 13px; color: var(--ink-soft); }

.product-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-price {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.add-btn {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}

.add-btn:hover { background: var(--teal-dark); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- Info strip ---------- */

.info-strip {
  background: var(--mint);
  color: var(--ink);
  padding: 44px 0;
}

.info-strip .wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.info-item h3 {
  color: var(--ink);
  font-size: 18px;
  margin-bottom: 6px;
}

.info-item p { color: var(--ink-soft); margin: 0; font-size: 14px; }

/* ---------- Contacto / footer ---------- */

.contact {
  padding: 64px 0;
}

.contact .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact h2 { font-size: 28px; }

.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.contact-card h3 { font-size: 16px; margin-bottom: 8px; }
.contact-card p { font-size: 14px; margin-bottom: 16px; }

site-footer, .site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Carrito (drawer) ---------- */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,36,32,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--white);
  z-index: 61;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.15);
}

.cart-drawer.open { transform: translateX(0); }

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

.cart-drawer-head h3 { font-size: 19px; margin: 0; }

.cart-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-line {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line-info { flex: 1; }
.cart-line-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cart-line-price { font-size: 13px; color: var(--ink-soft); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-control button {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--white);
  font-size: 14px;
  line-height: 1;
}

.remove-line {
  background: none;
  border: none;
  color: var(--teal-dark);
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
  align-self: flex-start;
}

.cart-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.cart-drawer-foot {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--line);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--serif);
  font-size: 20px;
  margin-bottom: 14px;
}

.cart-checkout {
  width: 100%;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cart-checkout:hover { background: #1fb956; }

.cart-hint { font-size: 12px; color: var(--ink-soft); margin-top: 10px; text-align: center; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 280px; margin: 0 auto; }
  .info-strip .wrap, .contact .wrap { grid-template-columns: 1fr; }
  .header-nav { display: none; }
}
