:root {
  --bg: #0b0b0b;
  --bg-soft: #121212;
  --surface: #171717;
  --surface-2: #1d1d1d;
  --text: #f4efe7;
  --muted: #b9aea1;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #d8c7b2;
  --accent-2: #9c7d61;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  width: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 199, 178, 0.13), transparent 34%),
    radial-gradient(circle at top right, rgba(156, 125, 97, 0.10), transparent 32%),
    linear-gradient(180deg, #090909 0%, #0c0c0c 45%, #111111 100%);
  color: var(--text);
  min-height: 100vh;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 100px 0 64px;
}

.sticky-bar {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0 16px;
  pointer-events: none;
}

.sticky-bar > * {
  pointer-events: auto;
}

.hero {
  border: 1px solid var(--line);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(23, 23, 23, 0.88), rgba(13, 13, 13, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14, 14, 14, 0.82);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.24);
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  background: #000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

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

.link {
  color: var(--muted);
}

.link:hover {
  color: var(--text);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 28px;
}

.hero-copy {
  padding: 24px 0 20px 0;
  max-width: 980px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.9rem);
  line-height: 0.98;
  margin: 16px 0 18px;
  max-width: 10ch;
}

.hero-copy p {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 18px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
}

.hero-points li::before {
  content: "•";
  color: var(--accent);
  margin-right: 8px;
}

.panel,
.info-card,
.auth-panel {
  border: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(16px);
  border-radius: 30px;
}

.panel {
  padding: 28px;
  margin-top: 24px;
}

.panel-soft {
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-header h2,
.auth-panel h2 {
  margin: 10px 0 0;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
}

.search {
  min-width: min(100%, 320px);
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.search input,
.auth-form input,
.auth-form select,
.checkout-discount input,
.entity-form input,
.entity-form textarea,
.entity-form select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

.search input:focus,
.auth-form input:focus,
.auth-form select:focus,
.checkout-discount input:focus,
.entity-form input:focus,
.entity-form textarea:focus,
.entity-form select:focus {
  border-color: rgba(216, 199, 178, 0.44);
  box-shadow: 0 0 0 4px rgba(216, 199, 178, 0.10);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.chip:hover,
.chip.is-active {
  transform: translateY(-1px);
  background: rgba(216, 199, 178, 0.10);
  border-color: rgba(216, 199, 178, 0.34);
}

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

.product-card {
  display: grid;
  gap: 16px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  transition: transform .2s ease, border-color .2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(216, 199, 178, 0.28);
}

.product-media {
  position: relative;
}

.product-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  object-fit: cover;
}

.stock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.8rem;
  padding: 8px 11px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}

.stock-badge.is-healthy {
  background: rgba(69, 135, 86, 0.18);
}

.stock-badge.is-low {
  background: rgba(204, 149, 67, 0.18);
}

.stock-badge.is-soldout {
  background: rgba(151, 63, 63, 0.18);
}

.product-copy h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.product-copy p,
.empty-state p,
.info-card p,
.auth-note,
.checkout-note,
.cart-empty span,
.footer p {
  color: var(--muted);
  line-height: 1.6;
}

.product-meta,
.cart-summary div,
.modal-specs div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-meta {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.92rem;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent), #f3e8dc);
  color: #181716;
}

.button-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.button-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.session-pill {
  min-width: 150px;
}

.footer-link {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--text);
}

.button-danger {
  background: rgba(214, 86, 86, 0.14);
  color: #ffd8d8;
  border: 1px solid rgba(214, 86, 86, 0.26);
}

.cart-button {
  position: relative;
}

.action-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.link-inline {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-inline:hover {
  opacity: 0.85;
}

.auth-switch-prompt {
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.cart-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #171717;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.info-card {
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-card span {
  color: var(--accent);
  font-size: 0.85rem;
}

.auth-panel {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 28px;
}

.auth-panel h2 {
  max-width: 16ch;
}

.modal-shell-account {
  width: 100%;
  max-width: none;
  height: 100vh;
  border-radius: 0;
  padding: 0;
}

.account-modal {
  display: grid;
  gap: 28px;
  min-height: 100%;
  padding: clamp(24px, 4vw, 56px);
  align-content: start;
}

.account-intro {
  display: grid;
  gap: 10px;
  max-width: 760px;
  padding-right: 0;
}

.account-badge {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(216, 199, 178, 0.18);
  background: rgba(216, 199, 178, 0.08);
  color: var(--accent);
}

.account-grid {
  display: grid;
  gap: 16px;
}

.auth-form,
.checkout-discount {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.auth-form {
  width: min(100%, 760px);
}

.auth-form[hidden] {
  display: none;
}

.checkout-discount {
  width: 100%;
}

.account-signed-in {
  width: min(100%, 760px);
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 12px;
}

.account-signed-in[hidden] {
  display: none;
}

.account-signed-in-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.account-signed-in-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.account-signed-in-row strong {
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.auth-form,
.checkout-discount,
.entity-form {
  display: grid;
  gap: 12px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.auth-switch-btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.auth-switch-btn:hover {
  color: var(--text);
}

.auth-switch-btn.is-active {
  background: linear-gradient(180deg, #f1e2cf, #d8c7b2);
  color: #1d1510;
  box-shadow: 0 12px 24px rgba(216, 199, 178, 0.18);
}

.auth-switch-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(216, 199, 178, 0.14);
}

.modal-shell-account .modal-close {
  top: 22px;
  right: 22px;
  z-index: 2;
}

.auth-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkout-discount {
  gap: 14px;
}

.checkout-discount.is-locked {
  opacity: 0.88;
}

.checkout-discount .field {
  gap: 8px;
}

.checkout-lock {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(216, 199, 178, 0.05);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 6px 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.empty-state,
.empty-search {
  padding: 32px;
  border-radius: 24px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  margin-top: 18px;
}

.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: rgba(17,17,17,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 14px 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 60;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  background: linear-gradient(180deg, rgba(16,16,16,0.98), rgba(10,10,10,0.98));
  border-left: 1px solid var(--line);
  padding: 22px;
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
}

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

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 40;
}

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

.cart-panel-header,
.modal-copy h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding-right: 6px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
}

.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
}

.cart-item h4 {
  margin-bottom: 4px;
}

.cart-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cart-item-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 11px;
}

.cart-summary,
.checkout-box {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.total-row {
  font-size: 1.1rem;
  color: var(--accent);
}

.paypal-slot {
  margin-top: 12px;
}

.checkout-note {
  font-size: 0.95rem;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  padding: 20px;
  display: none;
  place-items: center;
  background: rgba(0,0,0,0.54);
  z-index: 55;
}

.modal.is-open {
  display: grid;
}

.modal-shell {
  width: min(920px, 100%);
  border-radius: 30px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(9,9,9,0.98));
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.modal-image img {
  width: 100%;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.modal-copy {
  padding: 10px 10px 10px 0;
}

.modal-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.modal-specs {
  margin: 20px 0;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
}

.qty-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  width: fit-content;
}

.qty-row button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

.qty-row input {
  width: 64px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 1.1rem;
  outline: none;
}

.modal-actions {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .product-grid,
  .feature-grid,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .auth-switch {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .footer,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .checkout-discount {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 90px;
  }

  .hero {
    border-radius: 28px;
  }

  .hero-grid,
  .panel,
  .auth-panel {
    padding: 18px;
  }

  h1 {
    max-width: none;
  }

  .hero-actions,
  .product-actions,
  .auth-actions {
    flex-direction: column;
  }

  .topbar {
    border-radius: 28px;
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .topbar-actions {
    display: contents;
  }

  .brand {
    order: 2;
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand small {
    display: none;
  }

  .session-pill {
    order: 1;
  }

  .cart-button {
    order: 3;
  }

  .session-pill,
  .cart-button {
    min-width: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .session-pill .action-label,
  .cart-button .action-label {
    display: none;
  }

  .cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
  }

  .sticky-bar {
    top: 10px;
  }

  [data-admin-link] {
    order: 4;
  }

  .cart-panel {
    width: 100%;
  }

  .account-intro {
    padding-right: 0;
  }

  /* Interfaz de acceso más limpia en móvil: quitamos el selector superior
     y usamos solo el enlace inferior para cambiar entre iniciar sesión y registro. */
  .auth-switch {
    display: none;
  }

  .account-modal {
    padding: 20px 16px 32px;
    gap: 20px;
  }

  .auth-form,
  .account-signed-in {
    width: 100%;
    padding: 18px;
  }

  .account-badge {
    font-size: 0.85rem;
  }
}

/* ========== Banner de Cookies ========== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px;
  background: rgba(12, 12, 12, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s ease;
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.cookie-banner-content {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.95rem;
}

.cookie-banner-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner-actions .button {
  white-space: nowrap;
  padding: 12px 20px;
}

/* Móvil */
@media (max-width: 720px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-banner-actions .button {
    width: 100%;
  }
}