/* La Mara — estilo campo / talabartería */
:root {
  --cream: #fffced;
  --paper: #f7f0de;
  --sand: #ebdfc4;
  --leather: #452920;
  --leather-2: #5e3a2c;
  --saddle: #8a5536;
  --olive: #867738;
  --olive-dark: #6c5f2b;
  --ink: #1f1510;
  --muted: #7a6a5c;
  --line: #dccdb0;
  --danger: #9b2c1f;
  --ok: #4f6a2a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(69, 41, 32, .06), 0 8px 24px -12px rgba(69, 41, 32, .25);
  --display: 'Cinzel', 'Times New Roman', serif;
  --body: 'Lora', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--leather); text-underline-offset: 3px; }
a:hover { color: var(--saddle); }
h1, h2, h3 { font-family: var(--display); color: var(--leather); line-height: 1.2; letter-spacing: .02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.main { padding: 32px 0 72px; min-height: 60vh; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.inline { display: inline; }

/* ---------- Header ---------- */
.topbar {
  background: var(--leather);
  color: var(--cream);
  text-align: center;
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 7px 16px;
}
.ticker { display: grid; }
.ticker-item { grid-area: 1 / 1; margin: 0; opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease; visibility: hidden; }
.ticker-item.active { opacity: 1; transform: none; visibility: visible; }
.ticker-star { color: #c9b77a; margin: 0 .6em; }
@media (prefers-reduced-motion: reduce) { .ticker-item { transition: none; transform: none; } }
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--leather); letter-spacing: .08em; margin: 0; }
.brand-tag { font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--olive); }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a, .link-btn {
  font-family: var(--display); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--leather); padding: 8px 12px; border-radius: 6px;
  background: none; border: 0; cursor: pointer;
}
.main-nav a:hover, .link-btn:hover { background: var(--paper); color: var(--leather); }
.main-nav a.active { box-shadow: inset 0 -2px 0 var(--olive); }
.main-nav a.cart-link {
  position: relative; display: inline-grid !important; place-items: center; width: 46px; height: 46px; padding: 0; margin-left: 6px;
  border-radius: 50%; background: var(--leather); color: var(--cream); box-shadow: 0 4px 12px -4px rgba(69, 41, 32, .55);
  transition: transform .15s, background .15s;
}
.main-nav a.cart-link:hover { background: var(--leather-2); color: #fff; transform: translateY(-1px); }
.main-nav a.cart-link.active { box-shadow: 0 0 0 3px var(--cream), 0 0 0 5px var(--olive); }
.cart-link .badge { position: absolute; top: -4px; right: -6px; border: 2px solid var(--cream); min-width: 22px; height: 22px; border-radius: 11px; font-weight: 600; }
.badge {
  background: var(--olive); color: #fff; font-family: var(--body); font-size: .75rem; letter-spacing: 0;
  min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px;
}
.link-btn.danger { color: var(--danger); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 32px;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(135deg, var(--leather) 0%, #3a221a 100%);
  color: var(--cream);
  border-radius: 18px;
  padding: clamp(28px, 5vw, 64px);
  margin-bottom: 40px;
  overflow: hidden;
}
.hero::after { /* costura */
  content: ''; position: absolute; inset: 10px; border: 2px dashed rgba(255, 252, 237, .35); border-radius: 12px; pointer-events: none;
}
.hero h1 { color: var(--cream); font-size: clamp(1.8rem, 4vw, 2.9rem); }
.hero .eyebrow { color: #c9b77a; }
.lead { font-size: 1.1rem; max-width: 46ch; opacity: .9; margin: 0 0 24px; }
.hero-badge { justify-self: center; }
.hero-badge img {
  width: min(280px, 60vw); height: auto; border-radius: 50%;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .55), 0 0 0 6px rgba(255, 252, 237, .08);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--leather); color: var(--cream); border: 1px solid var(--leather);
  padding: 12px 22px; border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--leather-2); color: var(--cream); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--olive); outline-offset: 2px;
}
.btn-light { background: var(--cream); color: var(--leather); border-color: var(--cream); }
.btn-light:hover { background: #fff; color: var(--leather); }
.btn-ghost { background: transparent; color: var(--leather); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--leather); }
.btn-danger { background: transparent; color: var(--danger); border-color: #e3b8b0; }
.btn-danger:hover { background: #fbeae6; color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: .72rem; }
.btn-block { width: 100%; margin-top: 10px; }

/* ---------- Catálogo ---------- */
.eyebrow { font-family: var(--display); font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--olive); margin: 0 0 6px; }
.categories { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 28px; scroll-margin-top: 110px; }
.chip {
  font-family: var(--display); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--leather); padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.chip:hover { border-color: var(--saddle); color: var(--leather); }
.chip.active { background: var(--leather); border-color: var(--leather); color: var(--cream); }
/* Carrusel de categorías */
.cat-carousel { margin: 0 0 36px; scroll-margin-top: 110px; }
.cat-viewport { position: relative; }
.cat-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, calc((100% - 4 * 16px) / 5));
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 6px 4px 12px; cursor: grab;
  scrollbar-width: none; -ms-overflow-style: none;
  --fade: 96px;
}
.cat-track::-webkit-scrollbar { display: none; }
.cat-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.cat-track.dragging .cat-card { pointer-events: none; }
.cat-track img { -webkit-user-drag: none; user-select: none; }
/* Difuminado del lado donde quedan más categorías */
.can-next .cat-track { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); }
.can-prev .cat-track { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); }
.can-prev.can-next .cat-track {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
.cat-arrow {
  position: absolute; top: calc(50% - 46px); z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--leather);
  background: var(--cream); border: 1px solid var(--line); box-shadow: 0 6px 18px -6px rgba(69, 41, 32, .45);
  opacity: 0; visibility: hidden; transform: scale(.9); transition: opacity .2s, transform .2s, visibility .2s, background .15s;
}
.cat-arrow:hover { background: #fff; }
.cat-arrow-prev { left: -10px; }
.cat-arrow-next { right: -10px; }
.can-prev .cat-arrow-prev, .can-next .cat-arrow-next { opacity: 1; visibility: visible; transform: none; }
.cat-card {
  scroll-snap-align: start; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: transform .2s, border-color .2s;
}
.cat-card:hover { transform: translateY(-3px); color: var(--ink); }
.cat-card.active { border-color: var(--leather); }
.cat-img { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--leather); }
.cat-img > img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cat-card:hover .cat-img > img { transform: scale(1.05); }
.cat-placeholder { background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 12px, #f2e8d2 12px, #f2e8d2 24px); }
.cat-placeholder img { width: 38%; }
.cat-name { font-family: var(--display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .86rem; color: var(--leather); padding: 12px 14px 0; }
.cat-count { font-size: .82rem; color: var(--muted); padding: 2px 14px 12px; }
.cat-all .cat-name { padding-bottom: 12px; }
.cat-card.active .cat-name::after { content: ' ✦'; color: var(--olive); }

/* Imagen de categoría en el admin */
.cat-img-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.cat-thumb { width: 72px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--leather); flex-shrink: 0; }
.cat-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.cat-img-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; font-family: var(--display); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--leather); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; background: #fff; }
.file-btn:hover { background: var(--paper); }
.file-btn:focus-within { outline: 2px solid var(--olive); outline-offset: 2px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.small-link { font-size: .68rem; padding: 4px 6px; color: var(--danger); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2, .section-head h1 { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(69, 41, 32, .06), 0 16px 32px -14px rgba(69, 41, 32, .35); }
.card-img { aspect-ratio: 1; background: var(--paper); display: block; overflow: hidden; }
.card-img > img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img > img { transform: scale(1.04); }
.card-img > img.from-category, .product-img > img.from-category, .cart-thumb > img.from-category, .thumb > img.from-category { object-fit: contain; background: #3b241b; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-family: var(--body); font-weight: 600; letter-spacing: 0; font-size: 1.05rem; margin-bottom: 14px; }
.card-body h3 a { text-decoration: none; color: var(--ink); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.price { font-family: var(--display); font-weight: 600; color: var(--leather); font-size: 1.1rem; letter-spacing: .02em; }
.price-lg { font-size: 1.8rem; margin: 0 0 18px; }
.tag { display: inline-block; font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--leather-2); }

.img-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 12px, #f2e8d2 12px, #f2e8d2 24px);
}
.img-placeholder img { width: 46%; border-radius: 50%; opacity: .55; filter: sepia(.3); }

.empty { text-align: center; padding: 56px 16px; background: var(--paper); border-radius: var(--radius); border: 2px dashed var(--line); }
.empty p { margin: 0 0 18px; }

/* ---------- Producto ---------- */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.product-img { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.product-img > img { width: 100%; height: 100%; object-fit: cover; }
.description { white-space: pre-line; margin-bottom: 24px; }
.add-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.qty { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.qty input { width: 84px; }
.perks { list-style: none; padding: 20px 0 0; margin: 24px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 8px; font-size: .95rem; }
.perks li::before { content: '✦'; color: var(--olive); margin-right: 10px; }

/* ---------- Paneles / formularios ---------- */
.page-title { margin-bottom: 24px; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.summary { position: sticky; top: 100px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; font-weight: 500; margin-bottom: 16px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--cream);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--leather); }
input[type=file] { background: transparent; border-style: dashed; }
input:disabled { opacity: .7; }
textarea { resize: vertical; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; border-left: 4px solid; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-success { background: #eef3e2; border-color: var(--ok); color: #2f4116; }
.flash-info { background: #f6efd9; border-color: var(--olive); color: #4a4220; }
.flash-error { background: #fbeae6; border-color: var(--danger); color: #6f1f15; }

.auth { max-width: 460px; margin: 8px auto; }
.auth h1 { text-align: center; }
.auth-logo { margin: 0 auto 12px; border-radius: 50%; }

/* ---------- Carrito ---------- */
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto auto auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.cart-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--paper); }
.cart-thumb > img, .thumb > img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: flex; flex-direction: column; }
.cart-name { font-weight: 600; text-decoration: none; color: var(--ink); }
.cart-sub { font-weight: 600; min-width: 124px; text-align: right; }
.row-end { display: flex; justify-content: flex-end; margin-top: 16px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.summary-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .95rem; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; }

.thanks { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; border: 2px dashed var(--olive); }
.thanks img { border-radius: 50%; flex-shrink: 0; }
.thanks p { margin: 0; }

/* ---------- Tablas / admin ---------- */
.table-wrap { overflow-x: auto; padding: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-family: var(--display); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid #efe6d3; vertical-align: middle; }
.table tfoot td { border-bottom: 0; font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.inactive td { opacity: .55; }
.thumb-cell { width: 64px; }
.thumb { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--paper); }
.actions { white-space: nowrap; text-align: right; }
.actions form, .actions a { margin-left: 4px; }

.order-cell { white-space: nowrap; width: 84px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; color: var(--leather); border-radius: 6px; cursor: pointer; font-size: 1rem; line-height: 1; }
.icon-btn:hover:not(:disabled) { background: var(--paper); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.rename-form { display: flex; gap: 8px; align-items: center; min-width: 220px; }
.rename-form input { padding: 6px 10px; }
.field-hint { margin: -6px 0 14px; }
.admin-nav { overflow-x: auto; }
.admin-nav { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-nav a { font-family: var(--display); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: 10px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-nav a.active { color: var(--leather); border-color: var(--leather); }

.status { display: inline-block; font-size: .75rem; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; background: var(--sand); color: var(--leather-2); }
.status-nuevo { background: #f6efd9; color: #6b5a12; }
.status-contactado { background: #e8eef5; color: #2b4a6b; }
.status-pagado { background: #eef3e2; color: var(--ok); }
.status-enviado { background: #efe5f3; color: #5a2f6b; }
.status-entregado { background: #e2efe6; color: #1f5a33; }
.status-cancelado { background: #f3e3e0; color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { background: var(--leather); color: var(--cream); padding: 48px 0 0; position: relative; }
.site-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; border-top: 2px dashed rgba(255, 252, 237, .3); }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-bottom: 32px; align-items: start; }
.footer-brand { display: flex; gap: 16px; align-items: center; }
.footer-brand img { border-radius: 50%; }
.site-footer .brand-name { color: var(--cream); }
.muted-light { color: rgba(255, 252, 237, .7); margin: 4px 0 0; font-size: .95rem; }
.footer-title { font-family: var(--display); letter-spacing: .2em; text-transform: uppercase; font-size: .75rem; color: #c9b77a; margin: 0 0 12px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .95rem; }
.footer-list a { color: var(--cream); text-decoration: none; }
.footer-list a:hover { text-decoration: underline; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 252, 237, .15); padding: 16px 0 24px; font-size: .82rem; color: rgba(255, 252, 237, .6); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero, .product, .cart-layout { grid-template-columns: 1fr; }
  .hero-badge { order: -1; }
  .hero-badge img { width: 180px; }
  .summary { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-inner { flex-direction: column; align-items: stretch; }
  .brand { justify-content: center; }
  .main-nav { justify-content: center; }
  .main-nav a, .link-btn { padding: 6px 8px; font-size: .74rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .cat-track { grid-auto-columns: 62%; gap: 12px; --fade: 48px; }
  .cat-arrow { width: 38px; height: 38px; top: calc(50% - 40px); }
  .cat-arrow-prev { left: -6px; } .cat-arrow-next { right: -6px; }
  .cat-name { font-size: .78rem; }
  .card-body { padding: 12px; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card-foot .btn { width: 100%; }
  .two { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 56px 1fr auto; gap: 10px; }
  .cart-thumb { width: 56px; height: 56px; }
  .cart-sub { grid-column: 2; text-align: left; }
  .thanks { flex-direction: column; text-align: center; }
  .site-header { position: static; }
}

/* ---------- Miniaturas: segunda imagen al pasar el mouse ---------- */
.card-img { position: relative; }
.card-img > img.img-alt { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease, transform .4s; }
.card:hover .card-img > img.img-alt.ready { opacity: 1; }

/* ---------- Galería de la ficha de producto ---------- */
.gallery { display: grid; gap: 12px; min-width: 0; }
.gallery-main { position: relative; }
.gallery-track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.gallery-track:focus-visible { outline: 2px solid var(--olive); outline-offset: -4px; }
.gallery-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.gallery .cat-arrow { top: calc(50% - 23px); }
.gallery .cat-arrow-prev { left: 12px; }
.gallery .cat-arrow-next { right: 12px; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px; font-size: .78rem; letter-spacing: .08em;
  background: rgba(31, 21, 16, .72); color: var(--cream); padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gallery-thumb { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--paper); cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--leather); opacity: 1; }

/* ---------- Admin: galería del producto ---------- */
.gallery-admin { margin-bottom: 22px; scroll-margin-top: 110px; }
.img-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.img-item { display: grid; gap: 8px; }
.img-frame { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--paper); border: 2px solid var(--line); }
.img-item.is-main .img-frame { border-color: var(--leather); }
.img-frame img { width: 100%; height: 100%; object-fit: cover; }
.img-pos { position: absolute; left: 6px; top: 6px; font-family: var(--display); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; background: rgba(31, 21, 16, .78); color: var(--cream); padding: 2px 8px; border-radius: 999px; }
.img-item.is-main .img-pos { background: var(--olive); }
.img-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.icon-btn.danger { color: var(--danger); border-color: #e3b8b0; }
.upload-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.upload-preview .flash { grid-column: 1 / -1; margin: 0; }
.upload-preview figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--paper); }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview figcaption { position: absolute; left: 4px; top: 4px; font-size: .7rem; background: rgba(31, 21, 16, .75); color: var(--cream); border-radius: 999px; padding: 0 6px; }

@media (max-width: 860px) { .img-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .img-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-thumbs { gap: 6px; }
  .gallery .cat-arrow { width: 36px; height: 36px; top: calc(50% - 18px); }
}

/* Ayuda de resolución y avisos en la vista previa de subida */
.upload-hint { display: grid; gap: 4px; font-size: .82rem; line-height: 1.45; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: -6px 0 12px; }
.upload-hint strong { color: var(--leather); font-size: .86rem; }
.upload-preview .img-size { position: absolute; left: 0; right: 0; bottom: 0; font-size: .54rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-align: center; background: rgba(31, 21, 16, .7); color: var(--cream); padding: 1px 0; font-variant-numeric: tabular-nums; }
.upload-preview .too-small { outline: 2px solid var(--danger); }
.upload-preview .too-small .img-size { background: var(--danger); }
.upload-preview .not-square .img-size { background: var(--olive); }
.upload-preview .broken img { visibility: hidden; }
.upload-preview .broken { background: var(--danger-bg, #fbeae6); }

/* ---------- Carrusel principal de banners ---------- */
.hero-carousel { position: relative; margin-bottom: 40px; border-radius: 18px; overflow: hidden; background: var(--leather); isolation: isolate; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.hero-track.dragging a { pointer-events: none; }
.hero-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; border-radius: 0; min-height: clamp(360px, 38vw, 470px); }
.hero-slide .hero-text { position: relative; z-index: 1; max-width: 560px; padding-bottom: 28px; }
.hero .hero-title { color: var(--cream); font-size: clamp(1.7rem, 4vw, 2.8rem); }
.hero-slide.has-image { grid-template-columns: minmax(0, 1fr); background: #2a1912; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.hero-slide.has-image::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(31, 18, 12, .9) 0%, rgba(31, 18, 12, .72) 38%, rgba(31, 18, 12, .2) 70%, rgba(31, 18, 12, 0) 100%);
}
.hero-slide::after { z-index: 2; }
.hero-controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; align-items: center; gap: 12px; pointer-events: none; }
.hero-controls > * { pointer-events: auto; }
.hero-dots { display: flex; gap: 6px; }
.hero-dot { width: 36px; height: 20px; padding: 8px 0; border: 0; background: none; cursor: pointer; }
.hero-dot span { display: block; height: 4px; border-radius: 2px; background: rgba(255, 252, 237, .35); overflow: hidden; position: relative; }
.hero-dot.active span { background: rgba(255, 252, 237, .45); }
.hero-dot.active span::after { content: ''; position: absolute; inset: 0; background: var(--cream); transform-origin: left; transform: scaleX(1); }
.running .hero-dot.active span::after { animation: hero-progress var(--hero-delay, 6000ms) linear forwards; }
.hero-carousel:hover .hero-dot.active span::after, .hero-carousel:focus-within .hero-dot.active span::after { animation-play-state: paused; }
@keyframes hero-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero-pause { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 252, 237, .5); background: rgba(31, 18, 12, .35); color: var(--cream); display: grid; place-items: center; cursor: pointer; }
.hero-pause .i-play, .paused .hero-pause .i-pause { display: none; }
.paused .hero-pause .i-play { display: block; }
.hero-pause:focus-visible, .hero-dot:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
@media (max-width: 860px) {
  .hero-slide { min-height: 0; }
  .hero-slide.has-image { min-height: 440px; align-content: end; }
  .hero-slide.has-image::before { background: linear-gradient(0deg, rgba(31, 18, 12, .92) 0%, rgba(31, 18, 12, .7) 45%, rgba(31, 18, 12, .15) 100%); }
  .hero-slide .hero-text { padding-bottom: 36px; }
}

/* ---------- Admin: banners ---------- */
.banner-intro { margin: -12px 0 20px; max-width: 70ch; }
.banner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.banner-row { display: grid; grid-template-columns: auto 260px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 18px; }
.banner-row.inactive { opacity: .6; }
.banner-row .order-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; width: auto; }
.banner-pos { font-family: var(--display); font-weight: 700; color: var(--leather); }
.banner-preview { position: relative; display: block; aspect-ratio: 12 / 5; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, var(--leather), #3a221a); text-decoration: none; }
.banner-preview > img { width: 100%; height: 100%; object-fit: cover; }
.banner-preview.is-leather > img.banner-preview-logo { position: absolute; right: 8%; top: 12%; width: auto; height: 76%; border-radius: 50%; object-fit: contain; }
.banner-preview.has-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31, 18, 12, .85), rgba(31, 18, 12, 0) 75%); }
.banner-preview-text { position: absolute; z-index: 1; left: 12px; bottom: 10px; right: 40%; display: grid; color: var(--cream); line-height: 1.2; }
.banner-preview-text small { font-family: var(--display); font-size: .55rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold, #c9b77a); }
.banner-preview-text strong { font-family: var(--display); font-size: .82rem; }
.banner-preview.big { margin-bottom: 14px; }
.banner-meta { display: grid; gap: 4px; min-width: 0; }
.banner-meta code { font-size: .8rem; background: var(--paper); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.button-fields { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px 4px; margin: 0 0 16px; }
.button-fields legend { font-size: .92rem; font-weight: 500; padding: 0 6px; }
.upload-size.warn { color: var(--danger); }
.upload-size.note { color: var(--olive); }
.upload-size.ok { color: var(--ok); }
@media (max-width: 860px) {
  .banner-row { grid-template-columns: auto minmax(0, 1fr); }
  .banner-row .banner-meta, .banner-row .actions { grid-column: 2; text-align: left; }
}
.banner-meta .status { justify-self: start; }

/* Ubicación del texto en los banners: izquierda (por defecto), centro o derecha */
.hero-slide.align-center .hero-text { margin-inline: auto; text-align: center; }
.hero-slide.align-center .lead { margin-inline: auto; }
.hero-slide.align-right .hero-text { margin-left: auto; text-align: right; }
.hero-slide.align-right .lead { margin-left: auto; }
.hero-slide.has-image.align-center::before { background: radial-gradient(ellipse 70% 90% at 50% 50%, rgba(31, 18, 12, .82) 0%, rgba(31, 18, 12, .55) 55%, rgba(31, 18, 12, .25) 100%); }
.hero-slide.has-image.align-right::before { background: linear-gradient(270deg, rgba(31, 18, 12, .9) 0%, rgba(31, 18, 12, .72) 38%, rgba(31, 18, 12, .2) 70%, rgba(31, 18, 12, 0) 100%); }
/* Sin imagen (fondo de cuero con logo): el logo se ubica del lado opuesto, o arriba si el texto va centrado */
.hero-slide.align-right:not(.has-image) { grid-template-columns: 1fr 1.3fr; }
.hero-slide.align-right:not(.has-image) .hero-badge { order: -1; }
.hero-slide.align-center:not(.has-image) { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; }
.hero-slide.align-center:not(.has-image) .hero-badge { order: -1; }
.hero-slide.align-center:not(.has-image) .hero-badge img { width: min(150px, 40vw); }
@media (max-width: 860px) {
  .hero-slide.align-right:not(.has-image) { grid-template-columns: 1fr; }
  .hero-slide.has-image.align-center::before, .hero-slide.has-image.align-right::before { background: linear-gradient(0deg, rgba(31, 18, 12, .92) 0%, rgba(31, 18, 12, .7) 45%, rgba(31, 18, 12, .15) 100%); }
}

/* Admin: selector de ubicación y vista previa */
.align-fields { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; }
.align-fields legend { font-size: .92rem; font-weight: 500; padding: 0 6px; }
.align-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.form label.align-option { flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .85rem; text-align: center; background: #fff; }
.align-option input { position: absolute; opacity: 0; pointer-events: none; }
.align-option:has(input:checked) { border-color: var(--leather); box-shadow: inset 0 0 0 1px var(--leather); background: var(--paper); }
.align-option:has(input:focus-visible) { outline: 2px solid var(--olive); outline-offset: 2px; }
.align-mini { width: 72px; height: 30px; border-radius: 4px; background: linear-gradient(135deg, var(--leather), #3a221a); display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 7px; }
.align-mini i { display: block; height: 3px; border-radius: 2px; background: var(--cream); width: 60%; }
.align-mini i:nth-child(2) { width: 45%; opacity: .7; }
.align-mini i:nth-child(3) { width: 22%; height: 5px; margin-top: 2px; }
.align-mini.align-center { align-items: center; }
.align-mini.align-right { align-items: flex-end; }
.banner-preview.align-center .banner-preview-text { left: 15%; right: 15%; text-align: center; }
.banner-preview.align-right .banner-preview-text { left: 40%; right: 12px; text-align: right; }
.banner-preview.has-image.align-center::after { background: radial-gradient(ellipse at center, rgba(31, 18, 12, .75), rgba(31, 18, 12, .2)); }
.banner-preview.has-image.align-right::after { background: linear-gradient(270deg, rgba(31, 18, 12, .85), rgba(31, 18, 12, 0) 75%); }
.banner-preview.is-leather.align-right > img.banner-preview-logo { right: auto; left: 8%; }
.banner-preview.is-leather.align-center > img.banner-preview-logo { right: auto; left: calc(50% - 15%); top: 6%; height: 50%; }
.banner-preview.is-leather.align-center .banner-preview-text { bottom: 8px; }
/* Orden de capas del banner: imagen → degradé → texto → costura → controles */
.hero-bg { z-index: 0; }
.hero-slide.has-image::before { z-index: 1; }
.hero-slide .hero-text, .hero-slide .hero-badge { position: relative; z-index: 2; }
.hero-slide::after { z-index: 3; }
.hero-controls { z-index: 4; }

/* ---------- Íconos de acción con tooltip (admin) ---------- */
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -3px; }
.btn .ico { width: 16px; height: 16px; margin-right: 2px; }
.acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.acts form, td.actions form { display: inline-flex; margin: 0; }
.act {
  position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--leather); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.act:hover:not(:disabled) { background: var(--paper); border-color: var(--saddle); color: var(--leather); }
.act:disabled { opacity: .35; cursor: default; }
.act.danger { color: var(--danger); border-color: #e3b8b0; }
.act.danger:hover:not(:disabled) { background: var(--danger-bg, #fbeae6); border-color: var(--danger); color: var(--danger); }
.act.on { background: var(--leather); border-color: var(--leather); color: var(--cream); }
.act.on:hover:not(:disabled) { background: var(--leather-2); color: #fff; }
.act:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
/* Tooltip: aparece al pasar el mouse o al llegar con el teclado */
.act[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
  background: var(--ink); color: var(--cream); font-family: var(--body); font-size: .74rem; letter-spacing: 0; text-transform: none;
  white-space: nowrap; padding: 4px 9px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 30;
}
.act[data-tip]::before {
  content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: var(--ink); opacity: 0; transition: opacity .12s; pointer-events: none; z-index: 30;
}
/* Oculto con display:none para que no genere scroll horizontal en los bordes de la pantalla */
.act[data-tip]::after, .act[data-tip]::before { display: none; }
.act[data-tip]:hover::after, .act[data-tip]:focus-visible::after { display: block; opacity: 1; transform: translate(-50%, 0); animation: tip-in .12s ease; }
.act[data-tip]:hover::before, .act[data-tip]:focus-visible::before { display: block; opacity: 1; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 4px); } }
@media (hover: none) { .act[data-tip]:hover::after, .act[data-tip]:hover::before { display: none; } }
label.act { margin: 0; }
label.act input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* ---------- Contenido: cintilla ---------- */
.content-section { margin-bottom: 28px; scroll-margin-top: 110px; }
.content-section > .section-head { margin-bottom: 6px; }
.section-help { margin: 0 0 16px; max-width: 75ch; }
.ann-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.ann-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ann-row.inactive .ann-edit input { opacity: .55; text-decoration: line-through; }
.ann-pos { font-family: var(--display); font-weight: 700; color: var(--leather); text-align: center; }
.ann-edit { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ann-edit input { padding: 7px 10px; min-width: 0; }
.ann-new { display: flex; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line); }
.ann-new input { flex: 1; min-width: 0; padding: 8px 10px; }
.ann-new .btn { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) {
  .ann-row { grid-template-columns: 22px minmax(0, 1fr); }
  .ann-row .acts { grid-column: 2; justify-content: flex-start; }
  .ann-new { flex-direction: column; align-items: stretch; }
}
.banner-row .order-cell .act { width: 30px; height: 30px; }

/* ---------- Pedidos: filtros ---------- */
.order-search { display: flex; gap: 6px; align-items: center; }
.order-search input { width: min(360px, 60vw); padding: 7px 10px; }
.order-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.order-filters .chip { display: inline-flex; align-items: center; gap: 8px; }
.order-filters .chip-status { text-transform: uppercase; }
.chip-main { font-weight: 700; }
.chip-count { font-family: var(--body); letter-spacing: 0; font-size: .75rem; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--paper); color: var(--leather); }
.chip.active .chip-count { background: rgba(255, 252, 237, .2); color: var(--cream); }
.chip.is-closed:not(.active) { opacity: .7; }
.chip-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.filter-note { margin: 0 0 16px; }
@media (max-width: 600px) { .chip-sep { display: none; } .order-search { width: 100%; } .order-search input { flex: 1; width: auto; } }

/* ---------- Ingreso con redes sociales ---------- */
.social-login { display: grid; gap: 10px; margin: 4px 0 6px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 16px; border-radius: 8px; font-family: var(--body); font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; transition: filter .15s, box-shadow .15s; }
.social-btn:hover { filter: brightness(.96); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .25); }
.social-btn:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.social-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.social-google:hover { color: #1f1f1f; }
.social-facebook { background: #1877f2; color: #fff; }
.social-facebook:hover { color: #fff; }
.social-apple { background: #000; color: #fff; }
.social-apple:hover { color: #fff; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; color: var(--muted); font-size: .85rem; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.social-account { margin-top: 22px; }
.linked-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.linked-list li { display: flex; align-items: center; gap: 10px; }
.linked-list form { margin-left: auto; }
.social-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); }
.social-dot.social-google { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.social-login.compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.social-login.compact .social-btn { min-height: 40px; font-size: .88rem; }

/* ---------- Historial de estados de pedidos ---------- */
.last-change { display: block; font-size: .74rem; margin-top: 4px; white-space: nowrap; }
.history-row > td { background: var(--paper); padding: 0 !important; border-top: 0; }
.history-panel { padding: 16px 18px 18px; border-left: 3px solid var(--saddle); }
.history-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.history-head h3 { margin: 0; font-size: 1rem; }
.history { list-style: none; margin: 0; padding: 0; position: relative; }
.history::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.history-item { position: relative; display: grid; grid-template-columns: 9.5rem 1fr; gap: 2px 14px; padding: 8px 0 8px 22px; }
.history-item::before { content: ''; position: absolute; left: 0; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--saddle); }
.history-item.is-current::before { background: var(--leather); border-color: var(--leather); }
.history-when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; padding-top: 3px; }
.history-what { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-arrow { color: var(--muted); }
.history-who { grid-column: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-note { grid-column: 2; margin: 2px 0 0; font-style: italic; }
.role-tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; padding: 1px 7px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); color: var(--muted); }
.role-tag.role-admin { background: var(--leather); border-color: var(--leather); color: var(--cream); }
.history-change { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.history-change select { width: auto; min-width: 150px; }
.history-change input[name=note] { flex: 1 1 220px; }
.summary .history-title { margin-top: 26px; font-size: 1.05rem; }
.summary .history-item { grid-template-columns: 1fr; }
.summary .history-who, .summary .history-note { grid-column: 1; }
@media (max-width: 640px) {
  .history-item { grid-template-columns: 1fr; }
  .history-who, .history-note { grid-column: 1; }
}

/* ---------- Cintilla: siempre visible al hacer scroll ---------- */
.topbar.is-pinned { position: sticky; top: 0; z-index: 21; }
.topbar.is-pinned + .site-header { top: var(--topbar-h, 31px); }
.scroll-mode { margin: 4px 0 16px; }
.scroll-mode fieldset { border: 0; padding: 0; margin: 0; }
.scroll-mode legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.seg-option { position: relative; display: block; margin: 0; cursor: pointer; }
.seg-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-option span { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.seg-option small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.seg-option input:checked + span { border-color: var(--leather); box-shadow: inset 0 0 0 1px var(--leather); background: var(--cream); }
.seg-option input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 2px; }
@media (max-width: 520px) { .seg { grid-template-columns: 1fr; } }

/* ---------- Carrito: cantidades con + / − y guardado automático ---------- */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.stepper input[type=number] { width: 52px; border: 0; border-radius: 0; text-align: center; padding: 8px 2px; background: transparent; -moz-appearance: textfield; appearance: textfield; font-weight: 600; }
.stepper input[type=number]::-webkit-outer-spin-button, .stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number]:focus { outline: 2px solid var(--olive); outline-offset: -2px; }
.step-btn { width: 38px; border: 0; background: var(--paper); color: var(--leather); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: background .15s; }
.step-btn:hover:not(:disabled) { background: var(--sand); }
.step-btn:disabled { opacity: .35; cursor: default; }
.step-btn:focus-visible { outline: 2px solid var(--olive); outline-offset: -2px; }
.cart-item.is-removing { opacity: .4; pointer-events: none; transition: opacity .2s; }
#cart-form.is-saving .cart-sub, #cart-form.is-saving ~ .summary [data-cart-total] { opacity: .55; transition: opacity .15s; }
.cart-status { margin: 10px 0 0; min-height: 1.2em; }
.cart-status:empty { display: none; }
@media (max-width: 640px) {
  .cart-item .stepper { grid-column: 2; justify-self: start; }
  .cart-item .cart-remove { grid-column: 3; grid-row: 1; align-self: start; }
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Ventana de confirmación (cambio de rol) ---------- */
dialog.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 14px; padding: 26px 26px 22px; background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(31, 21, 16, .55); overflow: auto; }
dialog.modal::backdrop { background: rgba(31, 21, 16, .55); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-x { position: absolute; top: 12px; right: 12px; }
.role-page { max-width: 560px; }
.role-form p { margin: 0 0 10px; }
.role-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding-right: 36px; }
.role-head h2 { margin: 0 0 2px; font-size: 1.2rem; }
.role-head p { margin: 0; }
.role-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--leather); color: var(--cream); }
.role-head.is-demote .role-icon { background: var(--danger); }
.role-icon .ico { width: 22px; height: 22px; }
.role-powers { margin: 0 0 12px; padding-left: 20px; font-size: .92rem; }
.role-powers li { margin-bottom: 4px; }
.role-warn { background: #fbeae6; border-left: 3px solid var(--danger); color: #6e2117; padding: 8px 12px; border-radius: 6px; }
.role-form .check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-weight: 500; cursor: pointer; }
.role-form .check input { width: auto; margin-top: 4px; accent-color: var(--leather); }
.role-email { word-break: break-all; }
.role-form input[name=confirm] { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.role-form input[name=confirm].is-match { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.role-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.role-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) { .role-actions .btn { flex: 1 1 100%; } }

/* ---------- Teléfono argentino (+54 · área · número) ---------- */
.phone-field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.phone-field legend { padding: 0; margin-bottom: 6px; font-weight: 500; }
.phone-inputs { display: grid; grid-template-columns: auto 92px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.phone-prefix { flex: 1; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-weight: 600; color: var(--leather); }
.phone-field .phone-part { margin: 0; display: flex; flex-direction: column; gap: 3px; font-weight: 400; }
.phone-cap { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.phone-part input { margin: 0; font-variant-numeric: tabular-nums; }
.phone-help { display: block; margin-top: 6px; }
.phone-field.is-ok .phone-help { color: var(--ok); }
.phone-field.is-bad .phone-help { color: var(--danger); }
.phone-field.is-bad input { border-color: var(--danger); }
.cart-layout > * { min-width: 0; }
@media (max-width: 640px) { .cart-layout .table th, .cart-layout .table td { padding-left: 6px; padding-right: 6px; } }

/* ---------- Pantalla "Estamos trabajando" ---------- */
.maint-page { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, #5a3527 0%, var(--leather) 55%, #2c1912 100%); color: var(--cream); }
.maint-card { width: min(560px, 100%); text-align: center; padding: 40px 28px 34px; border-radius: 18px; background: rgba(255, 252, 237, .06);
  border: 1px dashed rgba(201, 183, 122, .55); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.maint-logo { border-radius: 50%; box-shadow: 0 0 0 6px rgba(255, 252, 237, .12); }
.maint-eyebrow { font-family: var(--display); letter-spacing: .25em; text-transform: uppercase; font-size: .74rem; color: #c9b77a; margin: 20px 0 8px; }
.maint-card h1 { font-family: var(--display); color: var(--cream); font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.15; margin: 0 0 14px; letter-spacing: .03em; }
.maint-text { font-size: 1.05rem; line-height: 1.6; color: rgba(255, 252, 237, .85); margin: 0 auto 26px; max-width: 44ch; white-space: pre-line; }
.maint-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.maint-links .btn { display: inline-flex; align-items: center; gap: 8px; background: var(--cream); color: var(--leather); border-color: var(--cream); }
.maint-links .btn-ghost { background: transparent; color: var(--cream); border-color: rgba(255, 252, 237, .5); }
.maint-links .ico { width: 18px; height: 18px; }
.maint-preview { margin: 26px 0 0; color: rgba(255, 252, 237, .7); }
.maint-preview a { color: #c9b77a; }
.maint-ribbon { background: #c9b77a; color: var(--ink); text-align: center; font-size: .85rem; padding: 7px 16px; }
.maint-ribbon a { color: var(--ink); font-weight: 600; }
.maint-section.is-on { border: 2px solid #c9b77a; }
.maint-fields { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 14px; max-width: 640px; }
.maint-actions { gap: 10px; }
.maint-logo { display: block; margin: 0 auto; }
.maint-form fieldset { border: 0; padding: 0; margin: 6px 0 4px; min-width: 0; }
.maint-form legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.maint-fields label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: .92rem; font-weight: 500; }

/* ---------- Acordeón (Admin → Contenido) ---------- */
.acc-intro { margin: -6px 0 16px; }
.acc { padding: 0; margin-bottom: 14px; overflow: hidden; }
.acc-head { list-style: none; display: flex; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; user-select: none; }
.acc-head::-webkit-details-marker { display: none; }
.acc-head:hover { background: var(--paper); }
.acc-head:focus-visible { outline: 2px solid var(--olive); outline-offset: -2px; }
.acc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-title h2 { margin: 0; font-size: 1.15rem; }
.acc-sub { color: var(--muted); font-size: .85rem; }
.acc-meta { flex: none; display: flex; align-items: center; gap: 8px; }
.acc-chev { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--saddle); border-bottom: 2px solid var(--saddle); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.acc[open] > .acc-head .acc-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.acc[open] > .acc-head { border-bottom: 1px dashed var(--line); }
.acc-body { padding: 18px 22px 22px; }
.acc-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.acc .banner-row.panel { box-shadow: none; border: 1px solid var(--line); }
.acc.maint-section.is-on { border: 2px solid #c9b77a; }
@media (max-width: 560px) {
  .acc-head { padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .acc-title { flex-basis: calc(100% - 30px); }
  .acc-meta { order: 3; }
  .acc-body { padding: 14px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) { .acc-chev { transition: none; } }

/* ---------- Usuarios: último ingreso y eliminar ---------- */
.last-login { white-space: nowrap; }
.last-login time { display: block; font-weight: 500; }
.last-login .small { display: block; font-size: .78rem; }
.act.is-off { opacity: .35; cursor: not-allowed; }
.act.is-off:focus-visible { opacity: .6; }
