/* ==========================================================================
   AMORA · Boutique de Vinos Artesanales — Sistema visual
   Borgoña #4A1425 · Negro sofisticado #171515 · Marfil cálido #E8DDCB · Dorado champagne #B99A62
   ========================================================================== */
:root {
  --amora-burgundy: #4A1425;
  --amora-burgundy-700: #3A0F1D;
  --amora-burgundy-600: #5C1A2F;
  --amora-burgundy-100: #F3E7EA;
  --amora-black: #171515;
  --amora-ivory: #E8DDCB;
  --amora-ivory-50: #FAF7F1;
  --amora-ivory-100: #F4EEE3;
  --amora-gold: #B99A62;
  --amora-gold-600: #A0844F;
  --amora-gold-100: #F3ECDD;
  --amora-ink: #2A2424;
  --amora-muted: #7A6F68;
  --amora-line: #E6DDCF;
  --amora-success: #3E7B58;
  --amora-danger: #A8323E;
  --amora-warning: #B8862F;
  --amora-info: #3D6A8A;
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;

  --bs-primary: var(--amora-burgundy);
  --bs-primary-rgb: 74, 20, 37;
  --bs-body-font-family: var(--font-sans);
  --bs-body-color: var(--amora-ink);
  --bs-body-bg: var(--amora-ivory-50);
  --bs-border-color: var(--amora-line);
  --bs-link-color: var(--amora-burgundy);
  --bs-link-color-rgb: 74, 20, 37;
  --bs-link-hover-color: var(--amora-burgundy-600);
  --bs-success-rgb: 62, 123, 88;
  --bs-danger-rgb: 168, 50, 62;
  --bs-warning-rgb: 184, 134, 47;
  --bs-info-rgb: 61, 106, 138;
  --bs-secondary-rgb: 122, 111, 104;
  --bs-dark-rgb: 23, 21, 21;
  --bs-border-radius: .5rem;
}

body { font-family: var(--font-sans); background: var(--amora-ivory-50); color: var(--amora-ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display-font { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 500; }
.eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .28em; font-size: .72rem; color: var(--amora-gold); font-weight: 500; }
.text-gold { color: var(--amora-gold) !important; }
.text-burgundy { color: var(--amora-burgundy) !important; }
.text-ivory { color: var(--amora-ivory) !important; }
.bg-burgundy { background: var(--amora-burgundy) !important; color: var(--amora-ivory); }
.bg-black { background: var(--amora-black) !important; color: var(--amora-ivory); }
.bg-ivory { background: var(--amora-ivory-100) !important; }
.tabular { font-variant-numeric: tabular-nums; }
a { text-decoration: none; }
::selection { background: var(--amora-gold); color: var(--amora-black); }

/* ---------- Botones ---------- */
.btn { font-weight: 500; letter-spacing: .02em; border-radius: .45rem; }
.btn-primary { --bs-btn-bg: var(--amora-burgundy); --bs-btn-border-color: var(--amora-burgundy); --bs-btn-hover-bg: var(--amora-burgundy-600);
  --bs-btn-hover-border-color: var(--amora-burgundy-600); --bs-btn-active-bg: var(--amora-burgundy-700); --bs-btn-active-border-color: var(--amora-burgundy-700);
  --bs-btn-disabled-bg: var(--amora-burgundy); --bs-btn-disabled-border-color: var(--amora-burgundy); --bs-btn-focus-shadow-rgb: 74, 20, 37; }
.btn-gold { --bs-btn-color: var(--amora-black); --bs-btn-bg: var(--amora-gold); --bs-btn-border-color: var(--amora-gold); --bs-btn-hover-bg: var(--amora-gold-600);
  --bs-btn-hover-border-color: var(--amora-gold-600); --bs-btn-hover-color: var(--amora-black); --bs-btn-active-bg: var(--amora-gold-600); }
.btn-outline-primary { --bs-btn-color: var(--amora-burgundy); --bs-btn-border-color: var(--amora-burgundy); --bs-btn-hover-bg: var(--amora-burgundy);
  --bs-btn-hover-border-color: var(--amora-burgundy); --bs-btn-active-bg: var(--amora-burgundy); }
.btn-outline-gold { --bs-btn-color: var(--amora-gold); --bs-btn-border-color: var(--amora-gold); --bs-btn-hover-bg: var(--amora-gold);
  --bs-btn-hover-color: var(--amora-black); --bs-btn-hover-border-color: var(--amora-gold); }
.btn-outline-ivory { --bs-btn-color: var(--amora-ivory); --bs-btn-border-color: rgba(232,221,203,.55); --bs-btn-hover-bg: var(--amora-ivory);
  --bs-btn-hover-color: var(--amora-burgundy); --bs-btn-hover-border-color: var(--amora-ivory); }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(185,154,98,.35); border-color: var(--amora-gold); }
.form-control, .form-select { border-color: #DCD1C1; }
.form-label { font-weight: 500; font-size: .86rem; color: #4d4342; margin-bottom: .3rem; }
.form-text { color: var(--amora-muted); }
.form-check-input:checked { background-color: var(--amora-burgundy); border-color: var(--amora-burgundy); }

/* ---------- Insignias de estado ---------- */
.badge { font-weight: 500; letter-spacing: .02em; padding: .38em .62em; }
.badge.text-bg-primary { background: var(--amora-burgundy) !important; }
.badge-soft { border: 1px solid transparent; }
.badge-soft.bg-success { background: #E4F0E8 !important; color: #2E6346 !important; }
.badge-soft.bg-danger { background: #F6E1E3 !important; color: #8D2733 !important; }
.badge-soft.bg-warning { background: #F7ECD6 !important; color: #86601A !important; }
.badge-soft.bg-info { background: #E1ECF3 !important; color: #2E5773 !important; }
.badge-soft.bg-primary { background: var(--amora-burgundy-100) !important; color: var(--amora-burgundy) !important; }
.badge-soft.bg-secondary { background: #EEE9E3 !important; color: #5E5550 !important; }
.badge-soft.bg-dark { background: #E3E0DE !important; color: #2C2727 !important; }

/* ==========================================================================
   PANEL ADMINISTRATIVO
   ========================================================================== */
.admin-body { background: var(--amora-ivory-50); min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; background: var(--amora-black); color: #cfc6b8; overflow-y: auto; z-index: 1040;
  scrollbar-width: thin; scrollbar-color: #3a3333 transparent; transition: transform .25s ease; }
.admin-sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(185,154,98,.18); }
.admin-sidebar .brand img { height: 42px; }
.admin-sidebar .brand .name { font-family: var(--font-display); font-size: 1.5rem; color: var(--amora-ivory); letter-spacing: .12em; line-height: 1; }
.admin-sidebar .brand .tag { font-size: .58rem; letter-spacing: .22em; color: var(--amora-gold); text-transform: uppercase; }
.admin-sidebar .nav-section { padding: 1rem 1.25rem .35rem; font-size: .62rem; text-transform: uppercase; letter-spacing: .24em; color: #8c8173; }
.admin-sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #d8cfc1; padding: .48rem 1.25rem; font-size: .9rem; border-left: 3px solid transparent; }
.admin-sidebar .nav-link i { font-size: 1rem; color: #9d9282; width: 1.1rem; text-align: center; }
.admin-sidebar .nav-link:hover { background: rgba(232,221,203,.05); color: #fff; }
.admin-sidebar .nav-link.active { background: linear-gradient(90deg, rgba(185,154,98,.16), transparent); color: #fff; border-left-color: var(--amora-gold); }
.admin-sidebar .nav-link.active i { color: var(--amora-gold); }
.admin-sidebar .nav-link .count { margin-left: auto; background: var(--amora-burgundy); color: var(--amora-ivory); font-size: .68rem; border-radius: 1rem; padding: .05rem .5rem; }
.admin-main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 1030; background: rgba(250,247,241,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--amora-line);
  display: flex; align-items: center; gap: 1rem; padding: .65rem 1.75rem; }
.admin-topbar .search { max-width: 360px; }
.admin-content { padding: 1.5rem 1.75rem 3rem; flex: 1; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 2rem; margin: 0; color: var(--amora-black); }
.page-header .subtitle { color: var(--amora-muted); margin: .2rem 0 0; font-size: .92rem; }
.module-code { font-size: .68rem; letter-spacing: .2em; color: var(--amora-gold); text-transform: uppercase; font-weight: 600; }
.card { border: 1px solid var(--amora-line); border-radius: .75rem; box-shadow: 0 1px 2px rgba(23,21,21,.03); }
.card-header { background: transparent; border-bottom: 1px solid var(--amora-line); font-weight: 500; padding: .85rem 1.1rem; }
.card-title-sm { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amora-muted); font-weight: 500; margin: 0; }
.kpi { padding: 1rem 1.1rem; height: 100%; }
.kpi .label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--amora-muted); }
.kpi .value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-size: clamp(1.35rem, 1.6vw, 1.85rem); font-weight: 600; color: var(--amora-black); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: .78rem; color: var(--amora-muted); }
.kpi.accent { background: var(--amora-burgundy); color: var(--amora-ivory); border-color: var(--amora-burgundy); }
.kpi.accent .label, .kpi.accent .hint { color: rgba(232,221,203,.75); }
.kpi.accent .value { color: #fff; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .62rem .8rem; border-bottom-color: #EFE8DC; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--amora-muted); font-weight: 500; background: var(--amora-ivory-100); border-bottom: 1px solid var(--amora-line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #FBF6EE; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-grid .sticky-col { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--amora-line); }
.plan-grid thead .sticky-col { background: var(--amora-ivory-100); z-index: 2; }
.plan-grid tfoot .sticky-col { background: var(--amora-ivory-100); }
.dashboard-more > summary { cursor: pointer; list-style: none; }
.dashboard-more > summary::-webkit-details-marker { display: none; }
.dashboard-more:not([open]) > summary { border-bottom: 0; }
.table tfoot td { font-weight: 600; background: var(--amora-ivory-100); }
.pnl-table td:first-child { white-space: nowrap; }
.pnl-table tr.total td { font-weight: 600; background: #FBF6EE; }
.pnl-table tr.grand td { font-weight: 700; background: var(--amora-burgundy-100); color: var(--amora-burgundy); }
.pnl-table tr.section td { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--amora-gold-600); background: transparent; padding-top: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filters .form-control, .filters .form-select { min-width: 150px; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--amora-muted); }
.empty-state i { font-size: 2rem; color: var(--amora-gold); display: block; margin-bottom: .5rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--amora-line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--amora-gold); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .meta { font-size: .76rem; color: var(--amora-muted); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: var(--amora-ivory-100); border-radius: .75rem; padding: .75rem; min-height: 300px; }
.kanban-col h6 { display: flex; justify-content: space-between; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.kanban-card { background: #fff; border: 1px solid var(--amora-line); border-radius: .6rem; padding: .7rem .8rem; margin-bottom: .6rem; }
.nav-tabs .nav-link { color: var(--amora-muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--amora-burgundy); border-bottom-color: var(--amora-gold); background: transparent; }
.nav-tabs { border-bottom: 1px solid var(--amora-line); }
.flow { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .78rem; }
.flow span { padding: .25rem .6rem; border-radius: 1rem; background: #EEE9E3; color: #6b615b; }
.flow span.done { background: var(--amora-burgundy); color: var(--amora-ivory); }
.flow span.current { background: var(--amora-gold); color: var(--amora-black); }
.flow i { color: #c9bfb0; font-size: .7rem; }
.line-items td { vertical-align: middle; }
.setup-list li { padding: .45rem 0; border-bottom: 1px dashed var(--amora-line); }
.stat-row { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px dashed var(--amora-line); font-size: .9rem; }
.stat-row:last-child { border-bottom: 0; }
.chart-box { position: relative; height: 260px; }
.alert { border-radius: .6rem; }
.pagination { --bs-pagination-color: var(--amora-burgundy); --bs-pagination-active-bg: var(--amora-burgundy); --bs-pagination-active-border-color: var(--amora-burgundy); margin-bottom: 0; }
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .admin-main { margin-left: 0; }
  .admin-content, .admin-topbar { padding-left: 1rem; padding-right: 1rem; }
}

/* ==========================================================================
   AUTENTICACIÓN
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--amora-burgundy) url('/images/brand/hero-monogram.jpg') center/cover; position: relative; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,21,21,.1), rgba(23,21,21,.55)); }
.auth-art .quote { position: absolute; bottom: 3rem; left: 3rem; right: 3rem; z-index: 1; color: var(--amora-ivory); font-family: var(--font-display); font-size: 1.8rem; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--amora-ivory-50); }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 767.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ==========================================================================
   TIENDA / SITIO PÚBLICO
   ========================================================================== */
.store-body { background: var(--amora-ivory-50); }
.store-topbar { background: var(--amora-black); color: #cbbfae; font-size: .78rem; letter-spacing: .06em; }
.store-nav { background: rgba(250,247,241,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--amora-line); }
.store-nav .navbar-brand img { height: 46px; }
.store-nav .nav-link { font-size: .82rem; text-transform: uppercase; letter-spacing: .16em; color: var(--amora-ink); padding: .5rem 1rem !important; }
.store-nav .nav-link:hover, .store-nav .nav-link.active { color: var(--amora-burgundy); }
.cart-pill { position: relative; }
.cart-pill .count { position: absolute; top: -4px; right: -8px; background: var(--amora-gold); color: var(--amora-black); font-size: .65rem; font-weight: 600; border-radius: 1rem; padding: .05rem .38rem; }
.hero { position: relative; background: var(--amora-burgundy); color: var(--amora-ivory); overflow: hidden; }
.hero .hero-img { position: absolute; inset: 0; background: url('/images/brand/hero-monogram.jpg') center right/cover; opacity: .95; }
.hero .hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(58,15,29,.97) 0%, rgba(58,15,29,.85) 40%, rgba(58,15,29,.1) 75%); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; font-weight: 500; }
.hero .lead { color: rgba(232,221,203,.85); font-weight: 300; max-width: 520px; }
.ornament { display: flex; align-items: center; gap: .9rem; color: var(--amora-gold); }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 48px; background: currentColor; opacity: .7; }
.section { padding: 5rem 0; }
/* El espacio .g-5 de Bootstrap (3rem) es mayor que el margen del contenedor: en celulares y tabletas la fila se salía 12px
   y la página se podía mover de lado. Con las columnas apiladas, el espacio horizontal baja a 1.5rem (el texto no se mueve). */
@media (max-width: 991.98px) { .row.g-5 { --bs-gutter-x: 1.5rem; } }
/* text-wrap: balance reparte un título largo en líneas parejas (sin una palabra sola al final). */
.section-title { font-size: clamp(2rem, 4vw, 3rem); color: var(--amora-black); text-wrap: balance; }
.section-dark { background: var(--amora-black); color: var(--amora-ivory); }
.section-dark .section-title { color: var(--amora-ivory); }
.section-burgundy { background: var(--amora-burgundy); color: var(--amora-ivory); }
.section-burgundy .section-title { color: var(--amora-ivory); }
.wine-card { background: #fff; border: 1px solid var(--amora-line); border-radius: 1rem; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; height: 100%; display: flex; flex-direction: column; }
.wine-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(74,20,37,.45); }
.wine-card .visual { background: radial-gradient(circle at 50% 70%, #fff 0%, var(--amora-ivory-100) 70%); padding: 1.5rem 1rem .5rem; display: flex; justify-content: center; }
.wine-card .body { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.wine-card .producer { font-size: .7rem; text-transform: uppercase; letter-spacing: .2em; color: var(--amora-gold-600); }
.wine-card h3 { font-size: 1.5rem; margin: .2rem 0 .4rem; color: var(--amora-black); }
.wine-card .price { font-family: var(--font-display); font-size: 1.45rem; color: var(--amora-burgundy); font-weight: 600; }
.bottle-svg { height: 230px; width: auto; filter: drop-shadow(0 14px 18px rgba(23,21,21,.18)); }
.bottle-svg.lg { height: 420px; }
/* Foto de la ficha del vino: marco fijo 4:5 (el de las fotos de producto); una foto más alta o más ancha se ajusta
   adentro sin recortarse ni deformarse, así todas las presentaciones ocupan el mismo espacio. */
.wine-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; }
/* Tablas compactas para tarjetas de media columna (BI): letra más pequeña y encabezados que pueden partirse en dos
   líneas, para que todas las columnas quepan en la tarjeta; si aun así no caben, su contenedor .table-responsive se desplaza. */
.table-compact { font-size: .76rem; }
.table-compact > :not(caption) > * > * { padding: .3rem .3rem; }
/* .table.table-compact gana a «.table thead th» (una sola línea) y a la primera columna de 140–170 px del panel. */
.table.table-compact thead th { white-space: normal; font-size: .62rem; letter-spacing: .04em; line-height: 1.2; vertical-align: bottom; }
.table-compact th.sortable::after { margin-left: .15em; }
.table.table-compact td:first-child, .table.table-compact th:first-child { min-width: 90px; }
.table-compact td.num { white-space: nowrap; }
/* % disponible en inventario (semáforo): el número siempre va escrito; el color solo lo refuerza. Contraste ≥ 5:1. */
.stock-pct { display: inline-block; min-width: 3.4em; padding: .05rem .4rem; border-radius: 999px; font-weight: 600; text-align: center; white-space: nowrap; }
.stock-pct.is-low { background: #F6E1E3; color: #8E2632; }
.stock-pct.is-mid { background: #FBE3CF; color: #964510; }
.stock-pct.is-high { background: #E0EEE5; color: #2C6142; }
/* Tablas del panel ordenables desde el encabezado (admin.js): ↕ sin ordenar, ↑ menor a mayor / A-Z, ↓ al revés. */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "\2195"; margin-left: .3em; opacity: .5; font-size: .85em; }
th.sortable:hover::after { opacity: .7; }
th.sortable[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; color: var(--amora-burgundy); }
th.sortable[aria-sort="descending"]::after { content: "\2193"; opacity: 1; color: var(--amora-burgundy); }
th.sortable:focus-visible { outline: 2px solid var(--amora-burgundy); outline-offset: -2px; }
/* Departamento + Ciudad / Municipios (x-coverage-fields): el envoltorio no rompe la grilla de columnas. Sus columnas reciben
   el espaciado de .row > * de Bootstrap con especificidad cero (:where), para que col-6, col-md-3… sigan definiendo el ancho. */
.coverage-pair { display: contents; }
:where(.row > .coverage-pair) > * { flex-shrink: 0; width: 100%; max-width: 100%; padding-right: calc(var(--bs-gutter-x) * .5); padding-left: calc(var(--bs-gutter-x) * .5); margin-top: var(--bs-gutter-y); }
/* Vista previa de fotos en el panel: tope de alto para que una foto alta no estire el formulario. */
.photo-preview { width: 100%; max-height: 260px; object-fit: contain; }
.feature { text-align: center; padding: 1.5rem; }
.feature i { font-size: 1.8rem; color: var(--amora-gold); }
.feature h4 { font-family: var(--font-display); font-size: 1.45rem; margin: .7rem 0 .35rem; }
.exp-card { border-radius: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--amora-line); height: 100%; }
.exp-card .date { background: var(--amora-burgundy); color: var(--amora-ivory); text-align: center; padding: .9rem; min-width: 84px; }
.exp-card .date .d { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.exp-card .date .m { font-size: .7rem; text-transform: uppercase; letter-spacing: .2em; color: var(--amora-gold); }
.plan-card { border: 1px solid rgba(185,154,98,.35); border-radius: 1rem; padding: 2rem 1.5rem; height: 100%; background: rgba(255,255,255,.03); }
.plan-card.featured { border-color: var(--amora-gold); background: rgba(185,154,98,.08); }
.store-footer { background: var(--amora-black); color: #bfb4a4; }
.store-footer h6 { color: var(--amora-gold); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; }
.store-footer a { color: #d9cfbf; }
.store-footer a:hover { color: var(--amora-gold); }
.legal-strip { background: #0e0c0c; color: #9c9180; font-size: .78rem; }
.size-option input { display: none; }
.size-option label { border: 1px solid var(--amora-line); border-radius: .6rem; padding: .6rem .9rem; cursor: pointer; background: #fff; min-width: 110px; }
.size-option input:checked + label { border-color: var(--amora-burgundy); box-shadow: inset 0 0 0 1px var(--amora-burgundy); background: var(--amora-burgundy-100); }
/* Cada presentación es un vino independiente: su tamaño se ve en la tarjeta y en la ficha, y la ficha enlaza las otras. */
.wine-card .wine-size { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: var(--amora-burgundy); border: 1px solid var(--amora-line); border-radius: 999px; padding: .1rem .6rem; margin-bottom: .6rem; }
.wine-size-title { font-size: .45em; font-family: var(--font-sans); letter-spacing: .06em; color: var(--amora-gold-600); vertical-align: middle; white-space: nowrap; }
.size-link { border: 1px solid var(--amora-line); border-radius: .6rem; padding: .6rem .9rem; background: #fff; min-width: 110px; color: var(--amora-black); text-decoration: none; }
.size-link:hover { border-color: var(--amora-burgundy); }
.size-link.active { border-color: var(--amora-burgundy); box-shadow: inset 0 0 0 1px var(--amora-burgundy); background: var(--amora-burgundy-100); }
.qty-input { max-width: 120px; }
.age-gate { position: fixed; inset: 0; z-index: 2000; background: rgba(23,21,21,.92); display: none; align-items: center; justify-content: center; padding: 1rem; }
.age-gate.show { display: flex; }
.age-gate .box { background: var(--amora-burgundy); color: var(--amora-ivory); max-width: 460px; width: 100%; border-radius: 1rem; padding: 2.5rem 2rem; text-align: center; border: 1px solid rgba(185,154,98,.4); }
.age-gate img { height: 90px; }
.whatsapp-float { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1050; width: 56px; height: 56px; border-radius: 50%; background: #1f8f4e; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: 0 10px 25px rgba(0,0,0,.25); }
.whatsapp-float:hover { color: #fff; background: #197a42; }
.sommelier-btn { position: fixed; right: 1.25rem; bottom: 5.4rem; z-index: 1050; }
.sommelier-panel { position: fixed; right: 1.25rem; bottom: 5.4rem; width: min(380px, calc(100vw - 2.5rem)); z-index: 1060; display: none; }
.sommelier-panel.show { display: block; }
.sommelier-panel .card { box-shadow: 0 25px 60px -20px rgba(23,21,21,.45); border-color: rgba(185,154,98,.5); }
.sommelier-panel .messages { max-height: 340px; overflow-y: auto; font-size: .9rem; white-space: pre-line; }
.sommelier-panel .msg-bot { background: var(--amora-ivory-100); border-radius: .75rem; padding: .6rem .8rem; margin-bottom: .5rem; }
.sommelier-panel .msg-user { background: var(--amora-burgundy); color: var(--amora-ivory); border-radius: .75rem; padding: .6rem .8rem; margin: 0 0 .5rem 2.5rem; }
.checkout-summary { position: sticky; top: 100px; }
.prose p { line-height: 1.75; }
.prose h2 { font-size: 1.7rem; margin-top: 2rem; }

/* ==========================================================================
   PORTAL DEL ALIADO
   ========================================================================== */
.portal-header { background: var(--amora-burgundy); color: var(--amora-ivory); }
.portal-header .nav-link { color: rgba(232,221,203,.8); }
.portal-header .nav-link.active, .portal-header .nav-link:hover { color: #fff; }

@media print {
  .admin-sidebar, .admin-topbar, .no-print, .store-nav, .store-footer, .whatsapp-float, .sommelier-btn { display: none !important; }
  .admin-main { margin: 0; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Visualización de datos (paleta categórica derivada de la marca; validada: banda de luminosidad, croma, daltonismo y contraste sobre #FFF) ---------- */
:root {
  --series-1: #8C2A45;  /* vino */
  --series-2: #B8893A;  /* dorado profundo */
  --series-3: #2B6CA3;  /* azul pizarra */
  --viz-grid: #EFE8DC;
  --viz-axis: #7A6F68;
  --viz-other: #8F857E;      /* gris de contexto: vendedores agrupados en «Otros» */
  --viz-reference: #CBC2B9;  /* gris más claro: referencia (tienda web), nunca compite con los vendedores */
}
.bar-inline { height: 8px; border-radius: 4px; background: var(--series-1); min-width: 2px; }
.bar-track { background: #F1EBE0; border-radius: 4px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
@media (max-width: 991.98px) {
  .hero .hero-shade { background: linear-gradient(180deg, rgba(58,15,29,.93) 0%, rgba(58,15,29,.86) 100%); }
  .hero .hero-img { background-position: center; opacity: .55; }
  .sommelier-btn { bottom: 5.2rem; font-size: .85rem; }
}
.page-header > .d-flex { align-items: center; }
.page-header .filters { flex-wrap: nowrap; align-items: center; }
.page-header .filters .form-control, .page-header .filters .form-select { min-width: 0; width: auto; }
@media (max-width: 767.98px) { .page-header .filters { flex-wrap: wrap; } }
.table td:first-child, .table th:first-child { min-width: 170px; }
.table-sm td:first-child, .table-sm th:first-child { min-width: 140px; }

/* ==========================================================================
   Portada: carrusel principal, marcas autorizadas, cava y compra rápida
   ========================================================================== */
.home-hero { position: relative; background: var(--amora-burgundy-700); }
.home-hero .carousel-item { transition-duration: .9s; }
.hero-slide { position: relative; min-height: clamp(340px, 30vw, 430px); display: flex; align-items: center; overflow: hidden;
  background: var(--amora-burgundy-700) var(--hero-img, none) center right / cover no-repeat; color: var(--amora-ivory); }
.hero-slide.theme-light { background-color: var(--amora-ivory-50); color: var(--amora-ink); }
.hero-slide-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(42,10,21,.94) 0%, rgba(42,10,21,.8) 34%, rgba(42,10,21,.18) 64%, rgba(42,10,21,0) 100%); }
.theme-light .hero-slide-shade { background: linear-gradient(90deg, rgba(250,247,241,.97) 0%, rgba(250,247,241,.86) 34%, rgba(250,247,241,.15) 64%, rgba(250,247,241,0) 100%); }
.hero-slide > .container { position: relative; z-index: 1; }
.hero-slide-content { max-width: 520px; padding: 2.25rem 0 3.25rem; }
/* Título del banner: la primera parte en una sola línea. Tope de 2.75rem para que ~12em quepan en los 520px del bloque;
   en celulares baja a 1.75rem y, por debajo de 576px, puede partirse si un título es más largo que la pantalla. */
.hero-slide-title { font-family: var(--font-display); font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.06; font-weight: 500; margin: 0 0 .9rem; color: inherit; }
@media (min-width: 576px) { .hero-slide-title > span { white-space: nowrap; } }
.hero-slide-title em { display: block; font-style: italic; color: var(--amora-gold); }
.theme-light .hero-slide-title em { color: var(--amora-burgundy); }
.theme-light .eyebrow { color: var(--amora-gold-600); }
.hero-slide-body { font-weight: 300; font-size: 1.02rem; line-height: 1.6; max-width: 460px; margin-bottom: 1.35rem; opacity: .88; }
.hero-slide-cta { --bs-btn-color: var(--amora-black); --bs-btn-bg: var(--amora-gold); --bs-btn-border-color: var(--amora-gold); --bs-btn-hover-bg: var(--amora-gold-600);
  --bs-btn-hover-border-color: var(--amora-gold-600); --bs-btn-hover-color: var(--amora-black); border-radius: 2rem; }
.theme-light .hero-slide-cta { --bs-btn-color: var(--amora-ivory); --bs-btn-bg: var(--amora-burgundy); --bs-btn-border-color: var(--amora-burgundy);
  --bs-btn-hover-bg: var(--amora-burgundy-600); --bs-btn-hover-border-color: var(--amora-burgundy-600); --bs-btn-hover-color: #fff; }
.hero-slide-cta::after { content: "\2192"; margin-left: .55rem; transition: transform .2s ease; display: inline-block; }
.hero-slide-cta:hover::after { transform: translateX(3px); }
.home-hero .carousel-indicators { margin-bottom: 1.1rem; }
.home-hero .carousel-indicators [data-bs-target] { width: 26px; height: 2px; border: 0; margin: 0 4px; background-color: var(--amora-gold); opacity: .45; }
.home-hero .carousel-indicators .active { opacity: 1; width: 40px; }
.home-hero .carousel-control-prev, .home-hero .carousel-control-next { width: 3.5rem; opacity: 0; transition: opacity .25s ease; }
.home-hero:hover .carousel-control-prev, .home-hero:hover .carousel-control-next,
.home-hero .carousel-control-prev:focus-visible, .home-hero .carousel-control-next:focus-visible { opacity: .75; }
.home-hero .carousel-control-prev-icon, .home-hero .carousel-control-next-icon { width: 1.4rem; height: 1.4rem; }

.brand-strip { background: var(--amora-ivory-100); border-bottom: 1px solid var(--amora-line); padding: 1.4rem 0 1.2rem; }
.brand-strip .eyebrow { color: var(--amora-gold-600); font-size: .68rem; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; list-style: none; margin: 0; padding: 0; animation: amora-marquee var(--marquee-duration, 40s) linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-track li { flex: 0 0 auto; padding: 0 2.4rem; display: flex; align-items: center; height: 58px; }
.brand-item { display: flex; align-items: center; height: 100%; }
.brand-logo { display: block; width: 150px; height: 46px; background-color: var(--amora-burgundy); opacity: .7; transition: opacity .3s ease;
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--amora-burgundy); opacity: .7; transition: opacity .3s ease; }
a.brand-item:hover .brand-logo, a.brand-item:hover .brand-name, a.brand-item:focus-visible .brand-logo, a.brand-item:focus-visible .brand-name { opacity: 1; }
@keyframes amora-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee-track { animation: none; }
}

.cava-section { background: var(--amora-ivory-50); }
.cava-intro { max-width: 560px; }
.cava-filters { background: #fff; border: 1px solid var(--amora-line); border-radius: 2rem; padding: .5rem; box-shadow: 0 14px 34px -26px rgba(74,20,37,.4); }
.cava-filters .form-control, .cava-filters .form-select { border-radius: 2rem; border-color: var(--amora-line); background-color: var(--amora-ivory-50); font-size: .92rem; }
.cava-filters .form-control:focus, .cava-filters .form-select:focus { border-color: var(--amora-gold); box-shadow: 0 0 0 .2rem rgba(185,154,98,.2); }
.search-field { position: relative; }
.search-field .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--amora-muted); pointer-events: none; }
.search-field .form-control { padding-left: 2.5rem; }
@media (max-width: 991.98px) { .cava-filters { border-radius: 1.1rem; } }

.wine-card { position: relative; }
.wine-card h3 a { text-decoration: none; }
.wine-card-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.quick-buy-btn { position: relative; z-index: 2; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.quick-buy-btn:hover { transform: scale(1.06); }

.quick-buy .modal-content { border: 0; border-radius: 1.1rem; background: var(--amora-ivory-50); box-shadow: 0 30px 60px -30px rgba(23,21,21,.55); }
.quick-buy .producer { font-size: .68rem; text-transform: uppercase; letter-spacing: .2em; color: var(--amora-gold-600); }
.qb-visual { width: 62px; height: 84px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: .75rem; overflow: hidden;
  background: radial-gradient(circle at 50% 70%, #fff 0%, var(--amora-ivory-100) 75%); }
.qb-visual svg, .qb-visual img { height: 76px !important; width: auto; filter: none; }
.qb-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.qb-options input { position: absolute; opacity: 0; pointer-events: none; }
.qb-options label { display: block; height: 100%; border: 1px solid var(--amora-line); border-radius: .75rem; padding: .55rem .75rem; background: #fff; cursor: pointer; transition: border-color .15s ease; }
.qb-options label:hover { border-color: var(--amora-gold); }
.qb-options input:checked + label { border-color: var(--amora-burgundy); box-shadow: inset 0 0 0 1px var(--amora-burgundy); background: var(--amora-burgundy-100); }
.qb-options input:focus-visible + label { outline: 2px solid var(--amora-gold); outline-offset: 2px; }
.qb-options input:disabled + label { opacity: .5; cursor: not-allowed; background: #f6f3ee; }
.qb-options .qb-ml { font-weight: 600; }
.qb-options .qb-price { color: var(--amora-burgundy); font-weight: 500; }
.qb-options .qb-was { font-size: .78rem; color: var(--amora-muted); text-decoration: line-through; }
.qb-options .qb-stock { font-size: .74rem; color: var(--amora-muted); }
.qb-total { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--amora-burgundy); }
.quick-buy [data-qb-next]:not(.d-none) { display: flex; }

@media (max-width: 767.98px) {
  .hero-slide { min-height: 420px; background-position: 72% center; }
  .hero-slide-shade { background: linear-gradient(180deg, rgba(42,10,21,.88) 0%, rgba(42,10,21,.76) 100%); }
  .theme-light .hero-slide-shade { background: linear-gradient(180deg, rgba(250,247,241,.93) 0%, rgba(250,247,241,.82) 100%); }
  .hero-slide-content { padding: 2rem 0 3rem; }
  .home-hero .carousel-control-prev, .home-hero .carousel-control-next { display: none; }
  .marquee-track li { padding: 0 1.6rem; }
  .brand-logo { width: 120px; height: 40px; }
}

/* Vista previa de la portada en el panel */
.banner-preview { border-radius: .9rem; overflow: hidden; border: 1px solid var(--amora-line); }
.banner-preview .hero-slide { min-height: 300px; }
.banner-preview .hero-slide-content { padding: 1.75rem 0 2rem; }
.banner-preview .hero-slide-title { font-size: 2rem; }
.brand-preview { background: var(--amora-ivory-100); border-radius: .75rem; padding: 1rem 1.5rem; display: inline-flex; align-items: center; min-height: 70px; }
.admin-thumb { width: 132px; height: 44px; object-fit: cover; border-radius: .4rem; border: 1px solid var(--amora-line); }
.table .brand-preview { padding: .35rem .8rem; min-height: 0; }
.table .brand-name { font-size: .95rem; letter-spacing: .08em; }
.table .brand-logo { width: 110px; height: 32px; }

/* Grado alcohólico en la tarjeta del vino */
.wine-card .visual { position: relative; }
.abv-pill { position: absolute; top: .75rem; left: .75rem; z-index: 1; background: rgba(255,255,255,.92); color: var(--amora-burgundy);
  border: 1px solid var(--amora-line); border-radius: 2rem; padding: .15rem .6rem; font-size: .72rem; font-weight: 500; letter-spacing: .04em; }

/* Precio por volumen */
.volume-hint { font-size: .74rem; color: var(--amora-gold-600); font-weight: 500; margin-top: .1rem; }
.volume-offer { color: var(--amora-burgundy); background: var(--amora-gold-100); border-radius: .5rem; padding: .45rem .7rem; }

/* Carrito: cantidades que se actualizan al escribir */
.cart-line .bottle-svg { height: 90px; }
.cart-qty { width: 84px; }
.cart-line-total { min-width: 110px; }
[data-cart-root].is-updating { opacity: .6; transition: opacity .15s ease; }

/* Aviso de entorno de desarrollo (APP_ENV_LABEL): franja fija arriba, imposible de confundir con la tienda oficial */
.env-ribbon { position: relative; z-index: 2000; background: #B8862F; color: #171515; text-align: center; font-size: .78rem; font-weight: 600; letter-spacing: .02em; padding: .3rem .75rem; }
