/* Base */
:root {
  --coffee: #251a14;
  --coffee-rgb: 37, 26, 20;
  --cream: #f7f3ef;
  --dark: #1f1f1f;
  --muted: #777
}

:root {
  --page-width: 1400px;
  --page-gutter: 2rem;
  --bg: var(--cream);
  --fg: #1f2937;
  --card: #ffffff;
  --border: #e6e6e6;
  --muted-fg: #6b7280;
  --footer-bg: #f3eee7;
  --footer-fg: #5a463a;
  --accent: #c67b4e;
  --accent-contrast: #ffffff;
  --price: #251a14;
  --footer-logo-height: 28px;
  --footer-logo-height-lg: 56px;
  --footer-logo-margin-bottom: .25rem
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0
}

body {
  font-family: 'Lora', Georgia, 'Times New Roman', Times, serif;
  color: var(--fg);
  background: var(--bg)
}

/* Reset de enlaces para evitar color morado en visitados y mantener consistencia */
a,
a:visited {
  color: inherit;
  text-decoration: none;
}

/* Encabezados y titulos usan Playfair Display */
h1,
h2,
h3,
h4,
h5,
h6,
.e-title,
.e-number {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif
}

/* Reemplazar clases de cuerpo de Tailwind en tema oscuro */
img {
  max-width: 100%;
  display: block
}

.container {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin-inline: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem
}

/* Barra superior */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 75;
  background: var(--dark);
  color: #fff;
  font-size: .875rem;
  opacity: 1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18)
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .5rem 0;
  text-align: center
}

.topbar .topbar-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: .875rem;
  cursor: pointer;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1
}

/* Encabezado (navbar fija a tope, no flotante) */
.site-header {
  position: fixed;
  top: var(--header-top, 0px);
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  isolation: isolate;
  overflow: hidden
}

.site-header .container {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1.25rem;
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin-inline: auto;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--fg)
}

/* Asegurar contenido por encima */
.site-header .brand,
.site-header .nav,
.site-header .actions {
  position: relative;
  z-index: 2
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--coffee);
  text-decoration: none;
  font-weight: 700
}

/* Marca en encabezado claro */
.site-header .brand {
  color: var(--coffee)
}

/* Asegurar altura consistente del logo (escritorio por defecto) */
.brand img {
  height: 80px;
  width: auto;
  display: block
}

/* Ligera transparencia y sombra sutil para mezclar sobre encabezado translucido */
.site-header .brand img {
  opacity: .92;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .15)) drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
  transition: opacity .2s ease, transform .2s ease
}

.site-header .brand:hover img {
  opacity: 1;
  transform: scale(1.02)
}

.nav {
  display: flex;
  gap: 1.75rem
}

.nav a {
  color: var(--dark);
  text-decoration: none;
  padding: .25rem 0;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease
}

.nav a.active,
.nav a:hover {
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--coffee)
}

/* Overrides de enlaces para encabezado claro */
.site-header .nav a {
  color: var(--fg)
}

.site-header .nav a.active,
.site-header .nav a:hover {
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--coffee)
}

.actions {
  display: flex;
  align-items: center;
  gap: .5rem
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--border);
  padding: .5rem .8rem;
  border-radius: .375rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease
}

.icon-btn.active {
  border-color: var(--coffee)
}

.badge {
  background: var(--coffee);
  color: #fff;
  font-size: .7rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  margin-left: .25rem
}

.hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: .5rem;
  cursor: pointer;
  color: var(--fg);
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: .375rem;
  transition: background-color .2s ease, transform .2s ease;
  position: relative;
  z-index: 100
}

.hamburger:hover {
  background: rgba(0, 0, 0, .04)
}

.hamburger.active {
  background: rgba(0, 0, 0, .08);
  transform: scale(1.05)
}

/* Botones del encabezado */
.site-header .icon-btn {
  background: var(--card);
  border-color: var(--border);
  color: var(--fg)
}

.site-header .icon-btn:hover {
  background: rgba(0, 0, 0, .06)
}

/* Capa de granos de cafe en el encabezado: ancho completo */
.nav-beans {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  opacity: .26;
  transition: opacity .25s ease
}

.beans-active .nav-beans {
  opacity: .34
}

.nav-beans .bean {
  position: absolute;
  width: var(--bean-size, 46px);
  height: auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .22)) saturate(110%) brightness(1.05);
  transform: translate(calc(var(--dx, 0px) * var(--fx, 1)), calc(var(--dy, 0px) * var(--fy, 1))) rotate(var(--rot, 0deg)) scale(var(--s, 1));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

@media (max-width: 1024px) {
  .nav-beans {
    display: none
  }
}

/* Menu movil */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  background: var(--card);
  border-radius: 0;
  width: 100%;
  margin: 0;
  position: fixed;
  z-index: 59;
  top: calc(var(--header-top, 0px) + var(--header-height, 96px));
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform .3s cubic-bezier(.4, .0, .2, 1), opacity .3s ease-out;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .08)
}

.mobile-menu[hidden] {
  display: none !important
}

.mobile-menu:not([hidden]) {
  display: flex;
  transform: translateY(0);
  opacity: 1
}

.mobile-menu>a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: background-color .2s ease, padding-left .2s ease
}

.mobile-menu>a:active {
  background: rgba(0, 0, 0, .06)
}

.mobile-menu>a:hover {
  background: rgba(0, 0, 0, .04);
  padding-left: 1.75rem
}

.mobile-menu>a:last-of-type {
  border-bottom: none
}

.mobile-menu>div {
  display: flex;
  flex-direction: column
}

.mobile-menu>div>a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: background-color .2s ease, padding-left .2s ease
}

.mobile-menu>div>a:active {
  background: rgba(0, 0, 0, .06)
}

.mobile-menu>div>a:hover {
  background: rgba(0, 0, 0, .04);
  padding-left: 1.75rem
}

.mobile-menu>div>a:last-child {
  border-bottom: none
}

.mobile-menu .user-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, .02) 0%, rgba(0, 0, 0, .01) 100%);
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem
}

.mobile-menu .user-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0
}

/* Seccion hero */
.hero {
  position: relative;
  padding: 4rem 0;
  text-align: center;
  isolation: isolate
}

/* Hero responsivo en móvil — banner con video, altura fija no pantalla completa */
@media (max-width: 767px) {
  .hero {
    padding: 2rem 1rem;
    min-height: clamp(220px, 56vw, 360px);
    background: var(--coffee); /* fallback si el video falla */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
  }

  /* Mostrar el video en móvil */
  .hero .hero-media {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    overflow: hidden
  }

  .hero .hero-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block
  }

  /* Restaurar overlay para legibilidad del texto */
  .hero-overlay {
    background: rgba(var(--hero-overlay-color), var(--hero-overlay-opacity-mobile))
  }

  /* Texto más compacto en banner móvil */
  .hero h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.7rem);
    margin-bottom: .4rem
  }

  .hero p {
    font-size: .9rem;
    margin-bottom: .75rem
  }
}

/* Fondo above the fold con video para viewports medianos o mas */
@media (min-width: 768px) {
  .hero {
    padding: 6rem 0;
    min-height: calc(85vh - var(--page-offset-top, 136px))
  }

  .hero .hero-media {
    position: absolute;
    /* extender hacia arriba desde el tope para cubrir barra superior y encabezado */
    top: calc(-1 * var(--page-offset-top, 136px));
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    opacity: 1;
    overflow: hidden
  }

  .hero .hero-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
  }

  /* Overlay con degradado: mas oscuro arriba, mas claro abajo */
  .hero .hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, .22) 55%, rgba(0, 0, 0, .10) 100%);
  }

  /* Neutralizar capa superior previa para evitar doble oscurecimiento */
  .hero .hero-media::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
  }
}

/* Capa overlay sobre el video para mejorar legibilidad del texto */
:root {
  --hero-overlay-color: 0, 0, 0;
  --hero-overlay-opacity: 0.46;
  --hero-overlay-opacity-mobile: 0.56
}

/* Overlay más oscuro para mejorar contraste del texto sobre el video */
.hero-overlay {
  position: absolute;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(var(--hero-overlay-color), var(--hero-overlay-opacity));
  transition: background-color .2s ease, opacity .2s ease
}

.hero .hero-media {
  z-index: -1
}

.hero>* {
  position: relative;
  z-index: 2
}

/* Clarificar la letra que aparece sobre el video: texto blanco, sombra suave y mayor contraste */
.hero {
  color: #fff
}

.hero h1 {
  color: #fff;
  text-shadow: 0 6px 20px rgba(0, 0, 0, .6);
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  line-height: 1.02;
  margin-bottom: .5rem
}

.hero p {
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 3px 12px rgba(0, 0, 0, .45);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  margin-bottom: 1rem
}

.hero .btn {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28)
}

@media (min-width: 768px) and (max-width: 1024px) {
  .hero-overlay {
    background: rgba(var(--hero-overlay-color), var(--hero-overlay-opacity-mobile))
  }
}



.btn {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: .6rem 1rem;
  border-radius: .375rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, filter .2s ease
}

.btn:hover {
  filter: brightness(1.05)
}

[data-press-effect] {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  transition: transform .18s ease
}

[data-press-effect].press-active {
  transform: translateZ(0) scale(.97)
}

[data-press-effect]::after {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at var(--press-x, 50%) var(--press-y, 50%), rgba(var(--coffee-rgb), .28) 0%, rgba(var(--coffee-rgb), .14) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  will-change: transform, opacity
}

[data-press-effect].press-active::after {
  animation: btn-press .45s ease-out
}

@keyframes btn-press {
  0% {
    opacity: .32;
    transform: scale(0)
  }

  60% {
    opacity: .18
  }

  100% {
    opacity: 0;
    transform: scale(1.35)
  }
}

/* Cuadricula */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .06)
}

.card .p {
  padding: 1rem
}

.price {
  color: var(--price);
  font-weight: 700
}

/* Filtros */
.filters {
  display: flex;
  gap: .5rem;
  padding: 1rem 0;
  position: sticky;
  top: 96px;
  background: var(--bg);
  z-index: 40;
  border-bottom: 1px solid var(--border)
}

.filters select {
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: .375rem;
  background: var(--card);
  color: var(--fg)
}

/* Pie de pagina */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  margin-top: 4rem;
  border-top: 1px solid rgba(0, 0, 0, .05)
}

.site-footer .container {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin-inline: auto
}

.footer-news {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06)
}

.footer-news .label {
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .9
}

.footer-news .input {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  max-width: 520px
}

.footer-news input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  padding: .4rem 0;
  color: inherit;
  font-size: 1.2rem;
  outline: none
}

.footer-news input::placeholder {
  color: #8a776d
}

.footer-news .arrow {
  border: 0;
  background: transparent;
  color: #5a463a;
  font-size: 1.2rem;
  cursor: pointer
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  padding: 1.25rem 0
}

.footer-social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  color: inherit
}

.site-footer .footer-social img {
  display: block;
  height: var(--footer-logo-height);
  width: auto;
  max-height: none;
  margin-bottom: var(--footer-logo-margin-bottom)
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 2rem
}

.footer-columns h4 {
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .75rem;
  color: inherit
}

.footer-columns a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: .3rem 0
}

.footer-columns a:hover {
  text-decoration: underline
}

.footer-locale {
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, .06);
  display: flex;
  align-items: center;
  gap: .5rem
}

.footer-locale select {
  border: 0;
  background: transparent;
  color: inherit;
  padding: .25rem 0
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, .06)
}

.footer-legal .links a {
  color: inherit;
  text-decoration: none;
  margin-right: 1rem
}

.footer-legal .links a:hover {
  text-decoration: underline
}

.footer-disclaimer {
  font-size: .8rem;
  line-height: 1.4;
  opacity: .9;
  color: #6a5a50;
  padding-bottom: 1.5rem
}

@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 1.25rem
  }

  .footer-news {
    flex-direction: column;
    align-items: flex-start
  }

  .footer-news .input {
    max-width: 100%
  }
}

/* Aviso emergente */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  background: rgba(31, 41, 55, .95);
  color: #fff;
  padding: .6rem .9rem;
  border-radius: .5rem;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
  max-width: 90vw
}

.toast[hidden] {
  display: none
}


/* Acordeon */
.accordion details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin: .5rem 0
}

.accordion summary {
  cursor: pointer;
  font-weight: 600
}

/* Capa de transicion (barrido/desvanecer) */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  z-index: 80
}

.transition-overlay.active {
  animation: wipe .55s ease both
}

@keyframes wipe {
  0% {
    transform: translateY(100%);
    opacity: 0
  }

  20% {
    opacity: 1
  }

  100% {
    transform: translateY(0);
    opacity: 1
  }
}

/* Adaptativo */
@media (max-width: 1024px) {
  .nav {
    display: none
  }

  .hamburger {
    display: inline-flex
  }

  .mobile-menu {
    display: flex
  }

  .mobile-menu[hidden] {
    display: none !important
  }

  /* Mantener logo balanceado en movil */
  .brand img {
    height: 36px
  }
}

/* Mostrar el toggle de tema como el último control dentro de .actions */

/* Small user icon button styling */
.user-icon {
  padding: .4rem .6rem
}

.user-icon svg {
  width: 18px;
  height: 18px;
  display: block
}

.user-icon:focus,
.user-icon:hover {
  background: rgba(0, 0, 0, .04);
  border-color: var(--border);
  outline: none
}

.user-icon[aria-label] {
  color: var(--fg)
}

/* Espaciado para evitar superposicion del encabezado fijo */
/* Asegurar que el contenido quede debajo de barra superior (si existe) y encabezado */
main.container {
  padding-top: calc(var(--header-top, 0px) + var(--header-height, 96px) + 12px)
}

.filters {
  display: flex;
  gap: .5rem;
  padding: 1rem 0;
  position: sticky;
  top: calc(var(--header-top, 0px) + var(--header-height, 96px) + 8px);
  background: var(--cream);
  z-index: 40;
  border-bottom: 1px solid #eee
}

/* Mobile Menu Overlay (evitar scroll) */
body.menu-open {
  overflow: hidden;
}

.mobile-menu:not([hidden]) {
  animation: slideDown .3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Banner promocional en tienda */
.promo-banner {
  margin-top: .6rem;
  margin-bottom: .6rem
}

.promo-inner {
  position: relative;
  display: block;
  background: transparent;
  border-radius: 1rem;
  overflow: hidden;
  max-height: 160px;
  border: 1px solid rgba(0, 0, 0, .06)
}

.promo-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px
}

.promo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.promo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.25rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.05) 35%, rgba(0, 0, 0, 0.25) 100%);
  color: #fff
}

.promo-text {
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  max-width: 60%
}

.promo-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.06;
  margin: 0;
  color: inherit
}

.promo-sub {
  font-size: .85rem;
  line-height: 1.15;
  opacity: 0.95;
  margin: 0;
  color: inherit;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis
}

@media (max-width: 1024px) {
  .promo-inner {
    max-height: none
  }

  .promo-media {
    height: 60px;
    min-height: 60px
  }

  .promo-overlay {
    padding: 0 .75rem;
    justify-content: flex-start
  }

  .promo-text {
    max-width: 80%;
    padding: .25rem .5rem
  }

  .promo-title {
    font-size: 1rem
  }

  .promo-sub {
    font-size: .72rem
  }
}

/* ===================================================
   Sección Fincas — Homepage (Fase 7)
=================================================== */
.home-farms {
  background: var(--cream);
  padding: 3rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.home-farms .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.home-farms__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.home-farms__title {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--coffee);
  margin: 0;
}

.home-farms__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-farms__link:hover {
  text-decoration: underline;
}

.home-farms__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 480px) {
  .home-farms__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .home-farms__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.home-farm-card__link {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.home-farm-card__link:hover {
  box-shadow: 0 6px 20px rgba(37, 26, 20, 0.12);
  transform: translateY(-2px);
}

.home-farm-card__img {
  width: 100%;
  aspect-ratio: 5/3;
  object-fit: cover;
  display: block;
}

.home-farm-card__img--ph {
  background: linear-gradient(135deg, var(--coffee), var(--accent));
  aspect-ratio: 5/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.home-farm-card__info {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.home-farm-card__region {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.home-farm-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--coffee);
}

.home-farm-card__alt {
  font-size: 0.8rem;
  color: #777;
}

/* Seccion de evidencia (pixel perfect) */
.evidence-section {
  position: relative;
  margin: 3rem 0 0
}

.evidence-inner {
  position: relative;
  z-index: 0;
  isolation: isolate;
  padding: 3rem 0
}

/* Fondo a ancho completo originado desde el contenedor interno */
.evidence-inner::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #f5efe5;
  z-index: -1
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2.5rem;
  align-items: start
}

.e-beans {
  position: absolute;
  pointer-events: none;
  user-select: none;
  width: 160px;
  height: auto;
  opacity: .95
}

.e-beans-left {
  left: -10px;
  bottom: -22px;
  transform: rotate(-8deg)
}

.e-beans-right {
  right: 14px;
  top: -18px;
  transform: rotate(10deg)
}

.e-left {
  grid-column: 1/2
}

.e-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  line-height: 1.05;
  color: #3b2a1f;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: .01em;
  margin: .25rem 0 1.25rem
}

.e-stat {
  color: #3b2a1f
}

.e-number {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #f27d00;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: .01em;
  margin-bottom: .4rem
}

.e-sub {
  margin: .15rem 0;
  font-size: 1.1rem;
  color: #4b3a2f
}

.e-stat-a {
  grid-column: 2/3
}

.e-stat-b {
  grid-column: 3/4
}

.e-mid {
  grid-column: 2/3;
  border-top: 1px solid rgba(0, 0, 0, .18);
  padding-top: 1rem;
  margin-top: .75rem
}

.e-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: #f6d9b6;
  border: 1px solid #f0c89a;
  color: #3b2a1f;
  border-radius: .6rem;
  padding: .4rem .7rem;
  margin: .25rem 0 1rem
}

.e-badge-num {
  background: #f27d00;
  color: #fff;
  font-weight: 700;
  border-radius: .45rem;
  padding: .2rem .45rem;
  font-size: .95rem
}

.e-badge-label {
  font-size: .95rem
}

.e-desc {
  color: #4b3a2f;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 38ch
}

.e-reasons {
  grid-column: 3/4;
  border-top: 1px solid rgba(0, 0, 0, .18);
  padding-top: 1rem;
  margin-top: .75rem
}

.e-reasons-title {
  color: #3b2a1f;
  font-size: 1.15rem;
  margin: .25rem 0 1rem;
  line-height: 1.4
}

.e-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .65rem;
  color: #cf6500
}

.e-list li {
  color: #cf6500;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem
}

.e-dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fbe3c7;
  color: #cf6500;
  font-weight: 700
}

.e-source {
  grid-column: 2/4;
  color: #6a5a50;
  font-size: .85rem;
  margin-top: 1.25rem
}

/* Boton de tema */

@media (max-width: 1024px) {
  .evidence-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem
  }

  .e-stat-a,
  .e-stat-b,
  .e-mid,
  .e-reasons,
  .e-source {
    grid-column: auto
  }

  .e-left {
    order: -1
  }

  .e-title {
    font-size: clamp(2rem, 8vw, 2.4rem)
  }

  .e-beans {
    width: 110px;
    opacity: .9
  }

  .e-beans-left {
    left: -8px;
    bottom: -16px
  }

  .e-beans-right {
    right: 6px;
    top: -12px
  }
}

/* Ajustar tamano del logo en pantallas grandes */
@media (min-width: 1024px) {
  .site-footer .footer-social img {
    height: var(--footer-logo-height-lg);
  }
}

/* Utilidad: texto atenuado respeta el tema */
.muted {
  color: var(--muted-fg)
}

/* ===== Trazabilidad (UI armoniosa) ===== */
/* ── Trazabilidad ──────────────────────────────────────────────────── */

/* Padding interno para cards de trazabilidad (no usan .p wrapper) */
.trace-input-col .card,
.trace-result-col .card {
  padding: 1rem
}

/* Deshabilitar el hover lift en cards de resultado */
.trace-result-col .card:hover {
  transform: none;
  box-shadow: none
}

/* Estado idle: visible pero opaco hasta que se escanee un código */
.trace-result--idle {
  opacity: .3;
  pointer-events: none;
  user-select: none;
  transition: opacity .5s ease
}

#result:not(.trace-result--idle) {
  opacity: 1;
  transition: opacity .5s ease
}

.trace-page {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.25rem;
  align-items: start;
  margin: 1rem 0 2rem
}

.trace-input-col,
.trace-result-col {
  display: flex;
  flex-direction: column;
  gap: 1rem
}

/* Tabs */
.trace-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem
}

.trace-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted-fg);
  margin-bottom: -1px;
  transition: color .18s, border-color .18s
}

.trace-tab.active {
  color: var(--coffee);
  border-bottom-color: var(--coffee)
}

.trace-tab svg {
  flex-shrink: 0
}

/* Scanner */
.scan-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: .75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111
}

.scan-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

#qrOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%
}

/* Viewfinder con esquinas */
.scan-viewfinder {
  position: absolute;
  inset: 0;
  pointer-events: none
}

.scan-viewfinder::before,
.scan-viewfinder::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border-color: var(--coffee);
  border-style: solid;
  border-width: 0
}

.scan-viewfinder::before {
  top: 18%;
  left: 18%;
  border-top-width: 3px;
  border-left-width: 3px;
  border-top-left-radius: 4px
}

.scan-viewfinder::after {
  bottom: 18%;
  right: 18%;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-bottom-right-radius: 4px
}

/* Esquinas adicionales via sombra del frame */
.scan-frame::before,
.scan-frame::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border-color: var(--coffee);
  border-style: solid;
  border-width: 0;
  z-index: 2;
  pointer-events: none
}

.scan-frame::before {
  top: 18%;
  right: 18%;
  border-top-width: 3px;
  border-right-width: 3px;
  border-top-right-radius: 4px
}

.scan-frame::after {
  bottom: 18%;
  left: 18%;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-bottom-left-radius: 4px
}

/* Idle hint superpuesto */
.scan-idle-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  text-align: center;
  pointer-events: none
}

.scan-line {
  position: absolute;
  left: 18%;
  right: 18%;
  height: 2px;
  background: var(--coffee);
  opacity: .8;
  animation: scanmove 1.8s ease-in-out infinite;
  border-radius: 1px
}

@keyframes scanmove {
  0%   { top: 22% }
  50%  { top: 74% }
  100% { top: 22% }
}

.trace-controls {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap
}

.trace-status {
  margin-top: .35rem;
  font-size: .83rem
}

.trace-panel {
  padding-top: .25rem
}

.trace-hint {
  margin-bottom: .75rem;
  font-size: .88rem
}

.trace-form {
  display: flex;
  flex-direction: column;
  gap: .4rem
}

.trace-form-row {
  display: flex;
  gap: .5rem;
  align-items: center
}

.trace-form-row input {
  flex: 1
}

.trace-error {
  color: #b91c1c;
  margin-top: .25rem;
  font-size: .85rem
}

/* Cómo funciona */
.trace-how h3 {
  margin-bottom: .75rem
}

.trace-how-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem
}

.trace-how-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .9rem
}

.trace-how-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--coffee);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  margin-top: .05rem
}

/* Estado vacío */
.trace-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  gap: .75rem;
  color: var(--muted-fg)
}

.trace-empty-icon {
  opacity: .35
}

.trace-empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0
}

.trace-empty p.muted {
  font-size: .9rem;
  max-width: 28ch;
  margin: 0
}

/* Hero card del resultado */
.trace-hero-card {
  display: flex;
  flex-direction: column;
  gap: .6rem
}

.trace-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem
}

.trace-hero-origin {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap
}

.trace-origin-badge {
  background: var(--coffee);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: 999px
}

.trace-altitude-badge {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  font-size: .75rem;
  font-weight: 500;
  padding: .25rem .65rem;
  border-radius: 999px
}

.trace-share-btn {
  flex-shrink: 0;
  font-size: .8rem;
  gap: .35rem
}

.trace-hero-name {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.3
}

.trace-lot-code {
  font-size: .82rem;
  font-family: monospace
}

/* Chips de proceso/variedad */
.trace-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem
}

.trace-chip {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .6rem;
  font-size: .8rem
}

/* Notas de sabor */
.trace-flavor-section {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding-top: .25rem;
  border-top: 1px solid var(--border)
}

.trace-flavor-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-fg)
}

.trace-flavor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem
}

.trace-flavor-chip {
  border-radius: 999px;
  padding: .22rem .65rem;
  font-size: .8rem;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg)
}

.trace-flavor-chip.flavor-sweet {
  background: rgba(180,120,40,.12);
  border-color: rgba(180,120,40,.35);
  color: var(--coffee)
}

.trace-flavor-chip.flavor-fruity {
  background: rgba(190,50,80,.1);
  border-color: rgba(190,50,80,.3);
  color: #a8274a
}

.trace-flavor-chip.flavor-chocolate {
  background: rgba(90,50,20,.1);
  border-color: rgba(90,50,20,.25);
  color: #5a3214
}

.trace-flavor-chip.flavor-floral {
  background: rgba(120,60,160,.1);
  border-color: rgba(120,60,160,.25);
  color: #6b3a96
}

/* Timeline */
.trace-section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600
}

.trace-timeline {
  list-style: none;
  padding: 0;
  margin: 0
}

.trace-timeline-item {
  display: flex;
  gap: .85rem;
  padding-bottom: 1.25rem
}

.trace-timeline-item:last-child {
  padding-bottom: 0
}

.trace-timeline-item:last-child .trace-timeline-line {
  display: none
}

.trace-timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0
}

.trace-timeline-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--card);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: background .2s, border-color .2s
}

.trace-timeline-item.done .trace-timeline-icon {
  background: var(--coffee);
  border-color: var(--coffee);
  filter: none
}

.trace-timeline-item.pending .trace-timeline-icon {
  opacity: .4
}

.trace-timeline-line {
  width: 2px;
  flex: 1;
  min-height: .75rem;
  background: var(--border);
  margin-top: .3rem
}

.trace-timeline-item.done .trace-timeline-line {
  background: var(--coffee);
  opacity: .35
}

.trace-timeline-content {
  padding-top: .3rem;
  padding-bottom: .25rem
}

.trace-timeline-stage {
  font-weight: 600;
  font-size: .9rem
}

.trace-timeline-item.pending .trace-timeline-stage {
  color: var(--muted-fg)
}

.trace-timeline-date {
  font-size: .8rem;
  color: var(--muted-fg);
  margin-top: .1rem
}

.trace-timeline-detail {
  font-size: .82rem;
  margin-top: .15rem
}

/* SCA Card */
.trace-sca-main {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem
}

.trace-sca-score-display {
  display: flex;
  align-items: baseline;
  gap: .2rem
}

.trace-sca-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--coffee);
  line-height: 1
}

.trace-sca-max {
  font-size: 1rem;
  color: var(--muted-fg)
}

.trace-sca-label {
  font-size: .85rem;
  color: var(--muted-fg);
  font-weight: 500
}

.trace-sca-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .25rem
}

.trace-sca-bar-fill {
  height: 100%;
  background: var(--coffee);
  border-radius: 999px;
  transition: width .6s ease
}

.trace-sca-bars {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border-top: 1px solid var(--border);
  padding-top: .85rem
}

.trace-sca-attr {
  display: grid;
  grid-template-columns: 5rem 1fr 5rem;
  align-items: center;
  gap: .5rem
}

.trace-sca-attr-label {
  font-size: .82rem;
  color: var(--muted-fg)
}

.trace-sca-attr-bar {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden
}

.trace-sca-attr-fill {
  height: 100%;
  background: var(--coffee);
  border-radius: 999px;
  transition: width .6s ease
}

.trace-sca-attr-val {
  font-size: .8rem;
  color: var(--fg);
  text-align: right
}

.trace-sca-package {
  font-size: .82rem;
  margin: .25rem 0 0
}

@media (max-width: 1024px) {
  .trace-page {
    grid-template-columns: 1fr
  }

  .scan-frame {
    aspect-ratio: 1/1
  }
}

/* Formularios (contacto, entrada manual) */
.form input,
.form textarea {
  width: 100%;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: .45rem;
  padding: .55rem .7rem
}

.form textarea {
  resize: vertical
}

/* Carrito: control de cantidad */
.cart-item {
  margin: .5rem 0
}

.cart-item-grid {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: .75rem;
  align-items: center
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: .45rem;
  justify-content: flex-end
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: .35rem
}

.cart-qty .qty {
  width: 62px;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .38rem 0;
  text-align: center;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--card);
  color: var(--fg);
  transition: border-color .2s ease, box-shadow .2s ease
}

.cart-qty .qty:focus {
  outline: none;
  border-color: rgba(var(--coffee-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--coffee-rgb), .18)
}

.cart-qty .qty::-webkit-outer-spin-button,
.cart-qty .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0
}

.cart-qty .qty {
  appearance: textfield;
  -moz-appearance: textfield
}

.cart-qty .qty-steppers {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: .45rem;
  overflow: hidden;
  background: var(--card)
}

.cart-qty .qty-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: .75rem;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease
}

.cart-qty .qty-step:hover {
  background: rgba(var(--coffee-rgb), .08)
}

.cart-qty .qty-step:active {
  background: rgba(var(--coffee-rgb), .14)
}

.cart-qty .qty-step span {
  pointer-events: none
}

/* Boton de icono en superficies oscuras */

/* Tienda (estilo Amazon serio y armonioso) */
.shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  position: sticky;
  top: calc(var(--header-top, 0px) + var(--header-height, 96px));
  background: var(--bg);
  z-index: 39;
  border-bottom: 1px solid var(--border)
}

.shop-topbar .chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem
}

.chip {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .9rem;
  cursor: pointer
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast)
}

.shop-topbar .actions {
  display: flex;
  align-items: center;
  gap: .75rem
}

.shop-topbar .filters-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  padding: .5rem .8rem;
  border-radius: .375rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease
}

.shop-topbar .filters-toggle:hover {
  background: rgba(0, 0, 0, .06)
}

.shop-topbar .sort select {
  padding: .4rem .55rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: .375rem
}

.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  padding: 1rem 0
}

.shop-sidebar {
  position: sticky;
  top: calc(var(--header-top, 0px) + var(--header-height, 96px) + 42px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1rem
}

.filter-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .9rem
}

.filter-title {
  font-weight: 600;
  margin-bottom: .5rem
}

.filter-list {
  display: grid;
  gap: .35rem
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: var(--fg)
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: .5rem
}

.price-inputs input {
  width: 100%;
  padding: .4rem .5rem;
  border: 1px solid var(--border);
  border-radius: .375rem;
  background: var(--card);
  color: var(--fg)
}

.filter-actions {
  display: flex;
  justify-content: flex-end
}

.btn.small {
  padding: .45rem .7rem;
  font-size: .9rem
}

.btn.outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border)
}

.btn.outline:hover {
  background: var(--card)
}

.shop-content .applied-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem
}

.pill {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .85rem
}

.pagination {
  display: flex;
  justify-content: center;
  padding: 1rem 0
}

.pager {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .35rem .6rem
}

.pager button {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .375rem;
  padding: .5rem .8rem;
  cursor: pointer;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease
}

.pager button:hover {
  background: rgba(0, 0, 0, .06)
}

.pager button[disabled] {
  opacity: .55;
  cursor: not-allowed
}

@media (max-width: 1024px) {
  .shop-layout {
    grid-template-columns: 1fr
  }

  .shop-sidebar {
    position: static;
    display: none
  }

  .shop-sidebar.open {
    display: block
  }

  .shop-topbar {
    position: sticky;
    top: calc(var(--header-top, 12px) + var(--header-height, 96px));
    z-index: 50
  }
}

/* Mobile: show chips as horizontal scroller for quick filters */
@media (max-width: 480px) {
  .shop-topbar {
    display: block;
    padding: .5rem 0
  }

  .shop-topbar {
    position: relative;
    display: block;
    padding: .5rem 0
  }

  .shop-topbar .chips-wrap {
    position: relative
  }

  .shop-topbar .chips {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: .25rem 0;
    white-space: nowrap;
    scroll-snap-type: x proximity
  }

  .shop-topbar .chips .chip {
    flex: 0 0 auto;
    display: inline-flex;
    scroll-snap-align: start
  }

  /* Shadow indicators for overflow */
  .shop-topbar .chips-wrap::before,
  .shop-topbar .chips-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38px;
    pointer-events: none;
    transition: opacity .2s ease;
    opacity: 0
  }

  .shop-topbar .chips-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, 0))
  }

  .shop-topbar .chips-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, 0))
  }

  /* Dark theme adjustments */

  /* Sticky filters button to the right */
  .shop-topbar .actions {
    position: sticky;
    top: .5rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-top: .5rem;
    justify-content: flex-end
  }

  .shop-topbar .filters-toggle {
    position: sticky;
    right: 0;
    z-index: 6
  }

  /* Make chips smaller on mobile to show more */
  .shop-topbar .chips .chip {
    padding: .28rem .5rem;
    font-size: .85rem
  }

  .shop-topbar .sort {
    display: inline-block
  }

  .shop-topbar .sort select {
    min-width: 120px
  }
}

/* Tamano uniforme para cards de tienda */
.shop-content .grid {
  align-items: stretch
}

.shop-content .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px
}

.shop-content .card>img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover
}

.shop-content .card .p {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1
}

.shop-content .card h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: .15rem 0 .25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2)
}

.shop-content .card .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.shop-content .card .price {
  margin-top: auto
}

/* Stock badges en cards de tienda */
.stock-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  margin-top: .2rem;
  margin-bottom: .1rem;
}
.stock-badge.out { background: #fee2e2; color: #b91c1c; }
.stock-badge.low { background: #fef9c3; color: #92400e; }

/* Link en nombre de producto dentro de card */
.card-name-link {
  text-decoration: none;
  color: inherit;
  transition: color .15s;
}
.card-name-link:hover { color: var(--accent); }

/* (modo compacto eliminado) */

/* Seccion de cafes en venta - Franja horizontal */
.coffee-shop {
  padding: 3rem 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.coffee-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
}

.coffee-shop-title {
  font-size: 1.8rem;
  margin: 0;
  color: var(--coffee);
}

.coffee-shop-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity .2s ease;
}

.coffee-shop-link:hover {
  opacity: .8;
}

.coffee-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0 2rem 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.coffee-scroll::-webkit-scrollbar {
  height: 8px;
}

.coffee-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .05);
  border-radius: 10px;
}

.coffee-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.coffee-scroll::-webkit-scrollbar-thumb:hover {
  background: #b06b43;
}

.coffee-card {
  position: relative;
  flex: 0 0 280px;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  transition: transform .3s ease, box-shadow .3s ease;
  padding: 1.2rem;
}

.coffee-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.coffee-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.coffee-badge {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  background: rgba(37, 26, 20, .92);
  color: #fff;
  padding: .3rem .7rem;
  border-radius: 15px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.coffee-badge.best-seller {
  background: linear-gradient(135deg, #c67b4e 0%, #a86240 100%);
}

.coffee-name {
  font-size: 1.25rem;
  margin: 0 0 .5rem;
  color: var(--coffee);
  font-weight: 600;
}

.coffee-notes {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.4;
}

.coffee-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coffee-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--coffee);
}

.btn-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-add:hover {
  background: #d88a5f;
  transform: scale(1.08);
}

/* Responsive para cafes */
@media (max-width: 768px) {
  .coffee-shop-header {
    padding: 0 1rem 1rem;
  }

  .coffee-scroll {
    padding: 0 1rem 1rem;
    gap: 1rem;
  }

  .coffee-card {
    flex: 0 0 240px;
    padding: 1rem;
  }

  .coffee-img {
    height: 160px;
  }

  .coffee-shop-title {
    font-size: 1.5rem;
  }
}

/* Destacados: ocupa 1/3 de la altura de la pagina */
.featured {
  position: relative;
  margin: 2rem 0 0;
  min-height: calc(100vh / 3);
}

.featured-inner {
  padding: 1.5rem 0
}

.featured-title {
  font-size: 1.6rem;
  margin: .25rem 0 1rem;
  color: #3b2a1f
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: .9rem;
  overflow: hidden
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3
}

.featured-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem
}

.featured-h3 {
  margin: .1rem 0 .2rem;
  font-size: 1.05rem;
  line-height: 1.35
}

.featured-desc {
  font-size: .95rem;
  line-height: 1.45
}

@media (max-width: 1024px) {
  .featured-grid {
    grid-template-columns: 1fr
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-img {
    aspect-ratio: 16 / 9
  }
}

/* Sección de Trazabilidad */
.traceability-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.traceability-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.traceability-text h2 {
  font-size: 2.5rem;
  color: var(--coffee);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.traceability-subtitle {
  font-size: 1.125rem;
  color: var(--muted-fg);
  margin-bottom: 3.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.traceability-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3.5rem;
  text-align: left;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .02);
  border: 1px solid rgba(0, 0, 0, .04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, .05);
}

.feature-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
}

.feature-item h3 {
  font-size: 1.125rem;
  color: var(--fg);
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  margin: 0;
  line-height: 1.5;
}

.traceability-cta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.cta-note {
  font-size: 0.875rem;
  color: var(--muted-fg);
  margin: 0;
  font-style: italic;
}

@media (max-width: 768px) {
  .traceability-section {
    padding: 3rem 0;
  }

  .traceability-features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .traceability-text h2 {
    font-size: 2rem;
  }

  .feature-item {
    padding: 1.25rem;
  }
}

/* Clases de utilidad para layouts admin */
.font-sans {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.bg-cream {
  background-color: var(--cream);
}

.text-ink {
  color: var(--ink);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.p-4 {
  padding: 1rem;
}

/* User Dropdown Menu */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: fixed;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 9999;
}

.user-dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-menu>div {
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border: none;
  background: none;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: var(--cream);
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-item:last-child:hover {
  color: #d32f2f;
}