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

:root {
  --font: "Inter", system-ui, sans-serif;
  --font-display: "DM Serif Display", Georgia, serif;
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --text-primary: #111318;
  --text-secondary: #2d3240;
  --text-muted: #5b6375;
  --border: #dde1e9;
  --accent: #b8391c;
  --accent-hover: #9c2f16;
  --accent-light: #faecea;
  --radius: 8px;
  --max-w: 960px;
}

[data-theme="dark"] {
  --bg: #161b26;
  --bg-subtle: #1d2333;
  --text-primary: #edf0f7;
  --text-secondary: #9ba3b8;
  --text-muted: #8a91a4;
  --border: #252d3f;
  --accent: #d94f2e;
  --accent-hover: #b8391c;
  --accent-light: #2a1410;
}

body {
  transition:
    background 0.2s,
    color 0.2s;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
}

/* NAV */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.2s;
}
.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}
.site-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.site-logo-placeholder {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition:
    color 150ms,
    background 150ms;
}
.site-nav-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}
.site-nav-links {
  display: flex;
  gap: 0.25rem;
}
.site-nav-toggle {
  display: none;
}
.site-nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    color 150ms,
    background 150ms;
}
.site-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}
.site-nav-link.active {
  color: var(--accent);
}

/* HERO */
.site-hero {
  min-height: calc(100dvh - 56px);
  display: flex;
  align-items: center;
  padding: 4rem 1.5rem;
}
.site-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.site-hero-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.site-hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  max-width: 60ch;
}
.site-hero-desc {
  color: var(--text-muted);
  max-width: 55ch;
  margin-bottom: 2rem;
}
.site-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* INTERIOR PAGES */
.site-page {
  padding: 4rem 1.5rem;
}
.site-page-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-page-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.site-page-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 60ch;
}
.site-page-body {
  max-width: 65ch;
  color: var(--text-muted);
  line-height: 1.8;
  white-space: pre-line;
}
.site-page-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 55ch;
}

/* BUTTONS */
.site-btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms;
}
.site-btn:hover {
  background: var(--accent-hover);
}
.site-btn-ghost {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 150ms,
    color 150ms;
}
.site-btn-ghost:hover {
  border-color: var(--text-muted);
}

/* CONSTRUCTION */
.construction-wrap {
  min-height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.construction-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}
.construction-wrap h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}
.construction-wrap p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* BLOG */
.site-post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.site-post-card:last-child {
  border-bottom: none;
}
.site-post-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.site-post-card h2 a {
  text-decoration: none;
  color: var(--text-primary);
}
.site-post-card h2 a:hover {
  color: var(--accent);
}
.site-post-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.site-post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-post-cta {
  display: inline-block;
  margin-top: 2rem;
}
.site-empty,
.site-loading {
  color: var(--text-muted);
  padding: 2rem 0;
}

/* CONTACT FORM */
.site-contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
  margin-top: 1.5rem;
}
.site-contact-form input,
.site-contact-form textarea {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition:
    border-color 150ms,
    background 0.2s,
    color 0.2s;
}
.site-contact-form input:focus,
.site-contact-form textarea:focus {
  border-color: var(--accent);
}
.site-contact-form textarea {
  resize: vertical;
}

.blog-grid {
  display: grid;
  gap: 1rem;
}
.blog-card {
  margin-bottom: 0;
}

/* PRODUCTOS */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.category-pill {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 150ms,
    color 150ms,
    background 150ms;
}
.category-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.category-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card-image {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle);
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-card-body {
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.product-card-body h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}
.product-card-body h2 a {
  text-decoration: none;
  color: var(--text-primary);
}
.product-price {
  font-weight: 600;
  color: var(--accent);
}
.product-stock-badge.out {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.product-add-btn {
  width: 100%;
  margin-top: 0.25rem;
  text-align: center;
}
.product-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cart-count-badge {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
}
.cart-icon-link {
  position: relative;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 2rem;
  align-items: start;
}
.product-detail-image {
  background: var(--bg-subtle);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
}
.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-detail-category {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.product-detail-price {
  display: block;
  font-size: 1.5rem;
  margin: 0.5rem 0;
}
.product-detail-desc {
  margin: 1rem 0;
}
.product-detail-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.product-qty-input {
  width: 4rem;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-primary);
  text-align: center;
}

/* CARRITO */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.cart-table th,
.cart-table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cart-table tfoot td {
  font-weight: 700;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  text-decoration: underline;
}
.cart-item-qty {
  width: 3.5rem;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-primary);
  text-align: center;
}

/* COOKIE BANNER */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 1000;
}
#cookie-banner p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}
#cookie-banner .site-btn {
  white-space: nowrap;
}
@media (max-width: 640px) {
  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  #cookie-banner p {
    flex: none;
  }
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}
.site-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.site-footer-links {
  display: flex;
  gap: 1.5rem;
}
.site-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--text-primary);
}

/* WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #25d366;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.whatsapp-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

/* REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.5s ease-out,
    transform 0.5s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  .site-nav-links {
    display: none;
  }
  .site-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .site-nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }
  .site-nav-links.open {
    display: flex;
  }
  .site-nav-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary, #1a1a1a);
  }
  .site-nav {
    position: relative;
  }

  .site-hero {
    padding: 3rem 1rem;
  }
  .site-hero h1,
  .site-hero-inner h1 {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
  }
  .site-hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .site-hero-actions a {
    width: 100%;
    text-align: center;
  }
  .site-page {
    padding: 2rem 1rem;
  }
  .site-page-inner {
    padding: 0;
  }
  .site-footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-card,
  .site-post-card {
    margin-bottom: 1rem;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .contact-form,
  .site-contact-form {
    padding: 1.5rem 1rem;
  }
  .contact-form input,
  .contact-form textarea,
  .site-contact-form input,
  .site-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (min-width: 769px) {
  .site-nav-toggle {
    display: none;
  }
}
