:root {
  --ink: #1c1410;
  --ink-soft: #3d2f26;
  --paper: #f3ebe0;
  --paper-deep: #e6d9c8;
  --cream: #fffaf3;
  --wine: #7a1f24;
  --wine-deep: #5c1519;
  --rust: #a34a2e;
  --gold: #c4a574;
  --muted: #6e5c4f;
  --line: #d9cbb8;
  --ok: #2f5d3a;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --shadow: 0 18px 40px rgba(28, 20, 16, .12);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(196,165,116,.18), transparent 40%),
    linear-gradient(180deg, #f7f1e8 0%, var(--paper) 40%, #efe4d4 100%);
  line-height: 1.5;
}
body.has-pedido { padding-bottom: 5.5rem; }
a { color: var(--wine); text-decoration: none; }
a:hover { color: var(--wine-deep); }
img { max-width: 100%; display: block; }
button { font: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-start;
  gap: .75rem; padding: .75rem 1.25rem;
  background: rgba(247, 241, 232, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, padding .2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(28,20,16,.06);
  padding-top: .55rem; padding-bottom: .55rem;
}
.brand {
  display: flex; align-items: center; gap: .7rem; color: inherit;
  min-width: 0;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(92,21,25,.2);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700; color: var(--wine-deep);
  letter-spacing: -.02em;
}
.brand-text small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.header-actions {
  display: flex; align-items: center; gap: .45rem; margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle {
  display: none;
  width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  position: relative;
  z-index: 70;
}
.nav-toggle span {
  display: block; width: 1.15rem; height: 2px;
  background: var(--wine-deep); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.nav-open { overflow: hidden; }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(28,20,16,.5);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
body.nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-desktop {
  display: flex; gap: .85rem; align-items: center; flex-wrap: wrap;
  margin-left: auto; margin-right: .35rem;
}
.nav-desktop a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.nav-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(300px, 88vw);
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 4.8rem 1.1rem 1.5rem;
  background: #fffaf3;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(28,20,16,.22);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(110%);
  visibility: hidden;
  pointer-events: none;
  transition: transform .22s ease, visibility .22s ease;
}
body.nav-open .nav-drawer {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.nav-drawer a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 1.05rem;
  padding: .9rem .75rem;
  border-radius: 8px;
}
.nav-drawer a:active,
.nav-drawer a:hover {
  background: var(--paper-deep);
  color: var(--wine-deep);
}
.nav-checkout-mobile {
  margin-top: .55rem;
  text-align: center;
  background: var(--wine);
  color: #fff !important;
  font-weight: 700;
}
.nav-checkout-mobile:hover,
.nav-checkout-mobile:active { background: var(--wine-deep) !important; color: #fff !important; }

@media (min-width: 861px) {
  .nav-drawer,
  .nav-backdrop { display: none !important; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: .72rem 1.2rem; text-decoration: none;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--wine); color: #fff;
  box-shadow: 0 8px 18px rgba(122,31,36,.25);
}
.btn-primary:hover { background: var(--wine-deep); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--wine-deep);
  border: 1px solid var(--wine);
}
.btn-ghost:hover { background: #f0e2d6; color: var(--wine-deep); }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }

/* Hero — full bleed video */
.hero {
  position: relative;
  min-height: min(86vh, 720px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fffaf3;
}
.hero-media {
  position: absolute; inset: 0;
  background: center / cover no-repeat var(--hero-img);
  overflow: hidden;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: ken 22s ease-in-out infinite alternate;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(28,20,16,.78) 0%, rgba(28,20,16,.45) 48%, rgba(28,20,16,.25) 100%),
    linear-gradient(180deg, rgba(28,20,16,.15) 0%, rgba(28,20,16,.72) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 5rem 0 3.2rem;
}
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: .78rem; font-weight: 700; color: var(--gold); margin: 0 0 .7rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7vw, 4.6rem);
  line-height: 1.02; margin: 0 0 .85rem; font-weight: 700;
  letter-spacing: -.03em; color: #fffaf3;
  text-shadow: 0 2px 24px rgba(0,0,0,.25);
}
.hero .lead {
  max-width: 34rem; font-size: 1.15rem; color: #f0e4d6; margin: 0 0 1.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.4rem; }
.hero-ghost { border-color: rgba(255,250,243,.55); color: #fffaf3; }
.hero-ghost:hover { background: rgba(255,250,243,.12); color: #fff; }
.hero-chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  list-style: none; margin: 0; padding: 0;
}
.hero-chips li {
  font-size: .8rem; font-weight: 700;
  padding: .35rem .7rem; border-radius: 999px;
  background: rgba(255,250,243,.12);
  border: 1px solid rgba(255,250,243,.22);
  color: #f7f1e8;
}

@keyframes ken {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

.section {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 3.4rem 0;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 .45rem; color: var(--wine-deep);
}
.section .sub {
  color: var(--muted); margin: 0 0 1.5rem; max-width: 36rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.step {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.15rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.step:hover { transform: translateY(-3px); }
.step-n {
  font-family: var(--font-display);
  color: var(--gold); font-weight: 700; font-size: 1.1rem;
}
.step h3 {
  font-family: var(--font-display);
  margin: .4rem 0 .35rem; font-size: 1.15rem; color: var(--ink);
}
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

.filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.25rem;
}
.filter {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .45rem .9rem;
  font-weight: 700; font-size: .88rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter:hover { border-color: var(--wine); }
.filter.is-active {
  background: var(--wine-deep); color: #fff; border-color: var(--wine-deep);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}
.product-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(28,20,16,.06);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.product-card.just-added {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}
.product-media {
  position: relative;
  aspect-ratio: 1 / .85;
  overflow: hidden;
  background: #2a1812;
}
.product-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.product-card:hover .product-media img { transform: scale(1.06); }
.tag {
  position: absolute; top: .7rem; left: .7rem;
  background: rgba(92,21,25,.92); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .28rem .55rem; border-radius: 999px;
}
.product-body { padding: .95rem 1rem 1.05rem; flex: 1; display: flex; flex-direction: column; }
.product-body .cat {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--rust); font-weight: 700; margin-bottom: .3rem;
}
.product-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; margin: 0 0 .35rem; color: var(--ink);
}
.product-body p {
  margin: 0 0 .85rem; color: var(--muted); font-size: .92rem; flex: 1;
}
.product-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.price { font-weight: 700; color: var(--wine-deep); font-size: 1.05rem; }
.price small { font-weight: 600; color: var(--muted); }

.strip {
  margin: 1rem 0 0;
  background: #2a1812;
  color: #f7f1e8;
}
.strip-inner {
  width: min(1100px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0;
}
.strip img {
  width: 100%; height: min(420px, 55vw);
  object-fit: cover; border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.strip h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 .7rem; color: #fffaf3;
}
.strip p { color: #e8d9c8; margin: 0 0 1.2rem; max-width: 34rem; }

.info-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 1.4rem;
}
.info-block {
  background: linear-gradient(160deg, var(--cream), var(--paper-deep));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.info-block h3 {
  font-family: var(--font-display);
  margin: 0 0 .8rem; color: var(--wine-deep);
}
.info-block dl { margin: 0; }
.info-block dt {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-top: .7rem;
}
.info-block dd { margin: .15rem 0 0; font-weight: 600; }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 280px; }
.map-embed { border: 0; width: 100%; min-height: 280px; filter: grayscale(.2) contrast(1.05); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.25rem 2.2rem;
  color: var(--muted); font-size: .9rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem;
  width: min(1100px, 92%); margin: 0 auto;
}
.demo-badge {
  font-size: .8rem; color: var(--muted);
  border: 1px dashed var(--line); padding: .3rem .6rem; border-radius: 999px;
  align-self: center;
}

.pedido-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(42, 24, 18, .96);
  color: #f7f1e8;
  border-top: 1px solid rgba(196,165,116,.35);
  box-shadow: 0 -12px 30px rgba(0,0,0,.25);
  animation: slideUp .25s ease;
}
.pedido-bar-inner {
  width: min(1100px, 94%);
  margin: 0 auto;
  padding: .85rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.pedido-preview {
  display: block; font-size: .82rem; color: #d4c2b0; margin-top: .15rem;
  max-width: 48vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pedido-bar-actions { display: flex; gap: .5rem; align-items: center; }
.pedido-bar .btn-ghost {
  border-color: rgba(255,250,243,.35); color: #fffaf3;
}
.pedido-bar .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* Panel (unchanged structure, refreshed tokens) */
.panel-body { background: #f3ebe0; min-height: 100vh; }
.panel-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.panel-mobile-bar { display: none; }
.sidebar {
  background: #2a1812; color: #f7f1e8; padding: 1.25rem 1rem;
}
.sidebar .brand { color: #f7f1e8; display: block; margin-bottom: 1.5rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .3rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem;
  color: #e8d9c8; padding: .6rem .75rem; border-radius: 8px; font-weight: 600;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { box-shadow: inset 3px 0 0 #c4a574; }
.nav-ico {
  width: 1.15rem; height: 1.15rem; flex-shrink: 0;
  display: block; object-fit: contain;
  opacity: .9;
}
.sidebar-nav a.active .nav-ico,
.sidebar-nav a:hover .nav-ico { opacity: 1; }
.panel-menu-btn { display: inline-flex; align-items: center; gap: .4rem; }
.panel-menu-btn .nav-ico { filter: none; }
.sidebar-logout { margin-top: 1.5rem; }
.sidebar-logout-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  color: #f7f1e8 !important; border-color: #c4a574 !important;
}
.sidebar-demo { margin-top: 1.5rem; font-size: .75rem; color: #b9a89a; }
.panel-main { padding: 1.25rem 1.4rem 2rem; }
.panel-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1.25rem;
}
.panel-top h1 {
  font-family: var(--font-display); font-size: 1.7rem; margin: 0; color: var(--wine-deep);
}
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .85rem;
  margin-bottom: 1.25rem;
}
.card-stat {
  background: var(--cream); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem;
}
.card-stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-stat .value { font-family: var(--font-display); font-size: 1.8rem; color: var(--wine-deep); margin-top: .2rem; }
.card-stat .value-sm { font-size: 1.45rem; }
.dash-sub { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.dash-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.dash-insight {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.dash-insight-k {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
}
.dash-insight strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--wine-deep);
  line-height: 1.25;
}
.dash-insight span:last-child { color: var(--muted); font-size: .88rem; }
.dash-toolbar {
  display: flex; align-items: center; justify-content: flex-end; gap: .75rem;
  margin-bottom: .75rem; flex-wrap: wrap;
}
.dash-toolbar-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.dash-period { display: inline-flex; gap: .35rem; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: .2rem; }
.dash-period-btn {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .82rem;
  color: var(--ink-soft); padding: .4rem .75rem; border-radius: 999px;
}
.dash-period-btn.is-active { background: var(--wine-deep); color: #fff; }
.dash-charts {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-chart-wide { grid-column: 1 / -1; }
.dash-chart-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap; margin-bottom: .35rem;
}
.dash-chart-head h2 { margin: 0; }
.dash-chart-hint { margin: 0; color: var(--muted); font-size: .82rem; }
.dash-canvas-wrap { position: relative; height: 240px; }
.dash-canvas-bar { height: 280px; }
.dash-detail {
  margin: .55rem 0 0;
  padding: .55rem .75rem;
  background: var(--paper-deep);
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--wine-deep);
}
.panel-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; }
.panel-box {
  background: var(--cream); border: 1px solid var(--line); border-radius: 6px; padding: 1rem;
}

/* TPV táctil */
.tpv-mode .panel-main { padding-bottom: 1rem; }
.tpv-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: .85rem; flex-wrap: wrap;
}
.tpv-top h1 {
  font-family: var(--font-display); font-size: 1.7rem; margin: 0; color: var(--wine-deep);
}
.tpv-top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tpv-filters {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem;
}
.tpv-filter {
  border: 1px solid var(--line); background: var(--cream); color: var(--ink-soft);
  border-radius: 10px; padding: .55rem .9rem; font-weight: 700; font-size: .9rem;
  cursor: pointer; min-height: 44px;
}
.tpv-filter.is-active { background: var(--wine-deep); color: #fff; border-color: var(--wine-deep); }
.tpv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 1rem;
  align-items: start;
}
.tpv-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .7rem;
}
.tpv-product {
  display: flex; flex-direction: column; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--cream); padding: 0; cursor: pointer;
  font-family: inherit; color: inherit;
  min-height: 190px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.tpv-product:hover { border-color: var(--wine); }
.tpv-product:active, .tpv-product.is-tapped {
  transform: scale(.97);
  box-shadow: 0 0 0 3px rgba(92,21,25,.2);
  border-color: var(--wine-deep);
}
.tpv-product-media {
  display: block; aspect-ratio: 1 / .85; overflow: hidden; background: #e8ddd0;
}
.tpv-product-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tpv-product-body {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .65rem .7rem .75rem; flex: 1;
}
.tpv-product-name {
  font-weight: 700; font-size: .95rem; line-height: 1.25; color: var(--ink);
}
.tpv-product-meta {
  font-size: .82rem; color: var(--wine-deep); font-weight: 700; margin-top: auto;
}
.tpv-cart {
  position: sticky; top: .75rem;
  display: flex; flex-direction: column; gap: .65rem;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
}
.tpv-cart-empty {
  color: var(--muted); font-size: .95rem; padding: .6rem 0 1rem;
}
.tpv-lines {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .55rem;
}
.tpv-line {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main remove"
    "qty imp";
  gap: .35rem .5rem;
  padding: .65rem .55rem;
  background: var(--paper-deep);
  border-radius: 10px;
  align-items: center;
}
.tpv-line-main { grid-area: main; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tpv-line-main strong { font-size: .92rem; line-height: 1.2; }
.tpv-line-main span { font-size: .78rem; color: var(--muted); }
.tpv-line-qty {
  grid-area: qty;
  display: inline-flex; align-items: center; gap: .35rem;
}
.tpv-qty-btn {
  width: 2.4rem; height: 2.4rem; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 1.2rem; font-weight: 700; color: var(--wine-deep);
  touch-action: manipulation;
}
.tpv-qty-val { font-weight: 700; min-width: 4.2rem; text-align: center; font-size: .9rem; }
.tpv-line-imp { grid-area: imp; font-weight: 700; color: var(--wine-deep); text-align: right; }
.tpv-line-remove {
  grid-area: remove; justify-self: end;
  width: 2rem; height: 2rem; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer;
}
.tpv-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}
.tpv-total-row strong {
  font-family: var(--font-display); font-size: 1.55rem; color: var(--wine-deep);
}
.tpv-field { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.tpv-field input {
  border: 1px solid var(--line); border-radius: 8px; padding: .7rem .75rem;
  font: inherit; color: var(--ink); background: #fff; min-height: 44px;
}
.tpv-pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.tpv-pay-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: .75rem .4rem; font-weight: 700; font-size: .88rem; cursor: pointer;
  color: var(--ink-soft); min-height: 48px; touch-action: manipulation;
}
.tpv-pay-btn.is-active { background: var(--wine-deep); color: #fff; border-color: var(--wine-deep); }
.tpv-cobrar {
  width: 100%; min-height: 52px; font-size: 1.05rem; border-radius: 12px;
  touch-action: manipulation;
}
.tpv-cobrar:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.tpv-hint { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.35; }
.panel-box h2 { font-size: 1.05rem; margin: 0 0 .8rem; font-family: var(--font-display); color: var(--wine-deep); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.prod-thumb-cell { width: 56px; vertical-align: middle !important; }
.prod-thumb {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  display: block; border: 1px solid var(--line); background: #e8ddd0;
}
.prod-desc { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
table.data td { vertical-align: middle; }
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--paper-deep); color: var(--ink-soft);
}
.badge.nuevo { background: #f3e0c8; color: #7a4d12; }
.badge.confirmado { background: #dde8f5; color: #1e3a5f; }
.badge.preparado { background: #e4efdf; color: #2f5d3a; }
.badge.entregado { background: #e8e2f0; color: #4a3560; }
.badge.facturado { background: #dfece4; color: #1b4332; }
.badge.whatsapp { background: #d9f0e3; color: #166534; }
.badge.web { background: #e7eef8; color: #1e3a5f; }
.badge.mostrador { background: #f0e6d8; color: #6b3f1d; }
.flash {
  background: #e4efdf; color: #1b4332; border: 1px solid #b7d0bc;
  padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem;
}
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(circle at 10% 20%, #c4a57433, transparent 40%),
    linear-gradient(160deg, #f7f1e8, #ebe1d2);
}
.login-page { margin: 0; background: #1c1410; }
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}
.login-visual {
  position: relative;
  overflow: hidden;
  min-height: 42vh;
  color: #fffaf3;
}
.login-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}
.login-visual-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(160deg, rgba(28,20,16,.35) 0%, rgba(28,20,16,.78) 100%),
    linear-gradient(90deg, rgba(92,21,25,.35), transparent 55%);
}
.login-visual-copy {
  position: relative; z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.4rem 2.2rem 2.8rem;
  max-width: 34rem;
}
.login-mark {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,250,243,.85);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  margin-bottom: 1.1rem;
}
.login-eyebrow {
  margin: 0 0 .55rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--gold);
}
.login-visual-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.08;
  margin: 0 0 .7rem;
  color: #fffaf3;
}
.login-visual-copy p:last-child {
  margin: 0;
  color: #e8d9c8;
  font-size: 1.05rem;
  max-width: 28rem;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.4rem;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(196,165,116,.18), transparent 45%),
    linear-gradient(180deg, #f7f1e8 0%, var(--paper) 100%);
}
.login-card {
  width: min(400px, 100%); background: var(--cream);
  border: 1px solid var(--line); border-radius: 8px; padding: 1.6rem;
}
.login-card-pro {
  width: min(420px, 100%);
  border-radius: 12px;
  padding: 2rem 1.7rem;
  box-shadow: var(--shadow);
  background: #fffaf3;
}
.login-kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rust);
}
.login-card h1,
.login-card h2 {
  font-family: var(--font-display);
  color: var(--wine-deep);
  margin: 0 0 .4rem;
}
.login-card h2 { font-size: 2rem; }
.login-card p,
.login-lead { color: var(--muted); margin: 0 0 1.2rem; }
.login-lead { font-size: .95rem; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; }
.field input {
  width: 100%; padding: .65rem .7rem; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; background: #fff;
}
.error { color: #9a1f1f; font-size: .88rem; margin-top: .35rem; }
.hint { margin-top: 1rem; font-size: .85rem; color: var(--muted); background: var(--paper-deep); padding: .7rem .8rem; border-radius: 4px; }

@media (max-width: 900px) {
  .steps, .info-grid, .strip-inner, .panel-grid, .dash-charts, .dash-insights, .tpv-layout { grid-template-columns: 1fr; }
  .dash-chart-wide { grid-column: auto; }
  .dash-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpv-cart { position: static; max-height: none; order: -1; }
  .tpv-catalog { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .strip img { height: 260px; }
  .pedido-preview { max-width: 90vw; }
  .login-split { grid-template-columns: 1fr; }
  .login-visual { min-height: 34vh; }
  .login-visual-copy { padding: 1.6rem 1.3rem 1.8rem; }
  .checkout-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }

  .panel-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .panel-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #2a1812;
    color: #fffaf3;
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .panel-mobile-bar .btn { color: #fffaf3; border-color: rgba(255,250,243,.35); }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 40;
    overflow: auto;
    box-shadow: 12px 0 40px rgba(0,0,0,.35);
  }
  .panel-shell.sidebar-open .sidebar { display: block; }
  .panel-main { padding: 1rem; }
  .panel-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { min-width: 520px; }
  .dash-insights { grid-template-columns: 1fr 1fr; }
  .dash-canvas-wrap { height: 220px; }
  .dash-canvas-bar { height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-video, .login-video { animation: none; }
}
@media (max-width: 860px) {
  .site-header {
    flex-wrap: nowrap;
    padding-left: .9rem;
    padding-right: .9rem;
  }
  .nav-desktop { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-cart { padding: .42rem .75rem; }
  .nav-drawer {
    transition: transform .22s ease, visibility .22s ease;
  }
  .brand-text small { display: none; }
  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin-bottom: 1.1rem;
  }
  .filter {
    width: 100%;
    text-align: center;
    border-radius: 10px;
    padding: .65rem .55rem;
    font-size: .9rem;
    line-height: 1.2;
  }
  .filter:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .hero { min-height: 72vh; }
  .hero-inner { padding: 4.2rem 0 2.4rem; }
  .hero .lead { font-size: 1.02rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 2.4rem 0; width: min(1100px, 94%); }
  .catalog-grid { grid-template-columns: 1fr; }
  .product-foot-col .add-form {
    flex-direction: column;
    align-items: stretch;
  }
  .qty-wrap { justify-content: space-between; width: 100%; }
  .add-form .add-btn { width: 100%; }
  .checkout-thumb { width: 44px; height: 44px; }
  .checkout-section .panel-box { overflow-x: auto; }
  .checkout-lines { min-width: 320px; }
  .ofertas-form { flex-direction: column; }
  .ofertas-form .btn { width: 100%; }
  .ofertas-band { padding: 1.3rem 1.1rem; }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    width: min(1100px, 94%);
  }
  .login-card-pro { padding: 1.4rem 1.15rem; }
  .pay-option { align-items: flex-start; }
}

.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
  margin-left: .35rem; border-radius: 999px;
  background: #fff; color: var(--wine-deep); font-size: .75rem;
}
.flash-public {
  width: min(1100px, 92%); margin: .8rem auto 0;
  background: #e4efdf; color: #1b4332; border: 1px solid #b7d0bc;
  padding: .7rem 1rem; border-radius: 6px;
}
.catalog-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem;
}
.catalog-head .sub { margin-bottom: 0; }
.checkout-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
}
.checkout-product {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.checkout-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--paper-deep);
}
.checkout-lines td { vertical-align: middle; }
.checkout-block-title {
  margin: 1rem 0 .55rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.checkout-section .field input {
  width: 100%; padding: .65rem .7rem; border: 1px solid var(--line);
  border-radius: 4px; font: inherit; background: #fff;
}
.inbox-grid { display: grid; grid-template-columns: .9fr 1.2fr; gap: 1rem; }
.inbox-list { list-style: none; margin: 0; padding: 0; }
.inbox-list a {
  display: block; padding: .55rem .6rem; border-radius: 6px;
  color: var(--ink); border: 1px solid transparent;
}
.inbox-list a:hover, .inbox-list a.is-active {
  background: var(--paper-deep); border-color: var(--line);
}
.inbox-list span { display: block; font-size: .8rem; color: var(--muted); }
.chat-thread { display: flex; flex-direction: column; gap: .65rem; max-height: 520px; overflow: auto; }
.bubble {
  max-width: 92%; padding: .7rem .85rem; border-radius: 10px;
  background: var(--paper-deep); border: 1px solid var(--line);
}
.bubble.out { align-self: flex-end; background: #e8f0e6; }
.bubble.in { align-self: flex-start; }
.bubble-meta { font-size: .72rem; color: var(--muted); margin-bottom: .25rem; }
.convert-form { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; align-items: center; }
.convert-form select, .sim-form input {
  padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit;
}
.badge.pagado { background: #dfece4; color: #1b4332; }
.badge.pendiente { background: #f3e0c8; color: #7a4d12; }
@media (max-width: 900px) {
  .checkout-grid, .inbox-grid { grid-template-columns: 1fr; }
}

.product-card.is-hidden,
.product-card[hidden] { display: none !important; }

.product-foot-col {
  flex-direction: column;
  align-items: stretch !important;
  gap: .65rem;
}
.add-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
}
.qty-wrap {
  display: inline-flex; align-items: center; gap: .25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem .35rem;
}
.qty-btn {
  width: 1.7rem; height: 1.7rem; border: 0; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink); font-size: 1rem;
  cursor: pointer; line-height: 1;
}
.qty-btn:hover { background: var(--wine); color: #fff; }
.qty-input {
  width: 3.2rem; border: 0; text-align: center; font: inherit; font-weight: 700;
  background: transparent; -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-unit { font-size: .8rem; font-weight: 700; color: var(--muted); padding-right: .25rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.cuenta-section { padding-top: 2.2rem; }
.cuenta-kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rust);
}
.cuenta-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.5rem;
  align-items: start;
}
.cuenta-bullets {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}
.cuenta-bullets li { margin-bottom: .35rem; }
.cuenta-box h3 {
  font-family: var(--font-display);
  margin: 0 0 .35rem;
  color: var(--wine-deep);
}
.cuenta-box-lead { margin: 0 0 1rem; color: var(--muted); }
.cuenta-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.cuenta-head .sub { margin-bottom: 0; }
.cuenta-orders { display: flex; flex-direction: column; gap: .65rem; }
.cuenta-order-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  align-items: center;
}
.cuenta-order {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.cuenta-order:hover {
  border-color: var(--wine);
  color: inherit;
  transform: translateY(-1px);
}
.cuenta-reorder-form { margin: 0; }
@media (max-width: 640px) {
  .cuenta-order-wrap { grid-template-columns: 1fr; }
  .cuenta-reorder-form .btn { width: 100%; }
}

.cuenta-recs {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.cuenta-recs-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  margin: 0 0 .35rem;
  color: var(--wine-deep);
}
.cuenta-recs-head .sub { margin-bottom: 0; }
.cuenta-recs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}
.cuenta-rec-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cuenta-rec-media {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-deep);
}
.cuenta-rec-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cuenta-rec-body {
  padding: .85rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}
.cuenta-rec-motivo {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rust);
}
.cuenta-rec-body strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.25;
}
.cuenta-rec-price {
  font-size: .9rem;
  font-weight: 700;
  color: var(--wine-deep);
  margin-bottom: .35rem;
}
.cuenta-rec-form { margin-top: auto; }
.cuenta-rec-form .btn { width: 100%; }
@media (max-width: 900px) {
  .cuenta-recs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cuenta-recs-grid { grid-template-columns: 1fr; }
}
.cuenta-order strong {
  display: block;
  font-family: var(--font-display);
  color: var(--wine-deep);
  font-size: 1.1rem;
}
.cuenta-order-meta {
  display: block;
  margin-top: .2rem;
  font-size: .85rem;
  color: var(--muted);
}
.cuenta-order-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
}
.cuenta-order-total { font-weight: 700; color: var(--ink); }

@media (max-width: 900px) {
  .cuenta-grid { grid-template-columns: 1fr; }
}

.ofertas-section { padding-top: 1.5rem; }
.ofertas-band {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.5rem;
  align-items: end;
  padding: 1.8rem 1.6rem;
  background:
    linear-gradient(135deg, rgba(122,31,36,.92), rgba(42,24,18,.94)),
    url('../img/products/board.jpg') center/cover;
  color: #fffaf3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ofertas-eyebrow { color: var(--gold) !important; margin-bottom: .35rem; }
.ofertas-copy h2 {
  color: #fffaf3;
  margin-bottom: .45rem;
}
.ofertas-copy .sub {
  color: #e8d9c8;
  margin-bottom: 0;
  max-width: 32rem;
}
.ofertas-form {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: stretch;
}
.ofertas-form input[type="email"] {
  flex: 1 1 12rem;
  min-width: 0;
  padding: .72rem .9rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  background: #fffaf3;
  color: var(--ink);
}
.ofertas-form .btn { white-space: nowrap; }
.ofertas-error {
  flex: 1 1 100%;
  color: #ffd7d0;
  margin: 0;
}

.social-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.social-head .sub { margin-bottom: 0; }
.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}
.social-post {
  display: flex;
  flex-direction: column;
  color: inherit;
  min-width: 0;
  transition: transform .2s ease;
}
.social-post:hover {
  transform: translateY(-3px);
  color: inherit;
}
.social-media {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.social-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.social-post:hover .social-media img { transform: scale(1.04); }
.social-body {
  padding: .75rem .1rem 0;
}
.social-meta {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rust);
  font-weight: 700;
  margin-bottom: .25rem;
}
.social-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: .25rem;
}
.social-body p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 900px) {
  .ofertas-band { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .social-grid { grid-template-columns: 1fr; }
}

.pay-methods {
  border: 1px solid var(--line); border-radius: 8px; padding: .85rem 1rem;
  margin: 1rem 0 .8rem; background: #fff;
}
.pay-methods legend {
  font-weight: 700; color: var(--wine-deep); padding: 0 .35rem;
}
.pay-option {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .55rem .2rem; cursor: pointer; border-bottom: 1px solid var(--line);
}
.pay-option:last-of-type { border-bottom: 0; }
.pay-option input { margin-top: .25rem; }
.pay-option span { display: flex; flex-direction: column; }
.pay-option small { color: var(--muted); font-size: .85rem; }
.pay-block { margin-top: .4rem; }
