/* ===== Subando - Mobile-first design system ===== */
:root {
  --bg: #0f172a;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --page-bg: #b9d4ec;          /* fondo azul claro de la app */
  --card-bg: #c7f7e7;          /* fondo aqua de las tarjetas */
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --bid-border: #880000;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .25);
  --container: 1180px;
  --safe-tap: 44px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ===== Header (mobile-first) ===== */
#site-header {
  background: var(--bg); color: #fff; box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
}
.brand { font-weight: 800; font-size: 20px; color: #fff !important; letter-spacing: .5px; }
.hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--safe-tap); height: var(--safe-tap);
  background: transparent; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; color: #fff; cursor: pointer;
}
.hamburger span { display:block; width:20px; height:2px; background:#fff; position:relative; }
.hamburger span::before, .hamburger span::after { content:''; position:absolute; left:0; width:20px; height:2px; background:#fff; }
.hamburger span::before { top:-6px; } .hamburger span::after { top:6px; }

.nav {
  position: fixed; inset: 0 0 0 auto; width: 80%; max-width: 320px;
  background: var(--bg); padding: 72px 20px 20px;
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; gap: 8px; z-index: 49;
  box-shadow: -10px 0 30px rgba(0,0,0,.3);
}
.nav.open { transform: translateX(0); }
.nav a, .nav button { color: #e2e8f0 !important; padding: 12px 14px; border-radius: 8px;
  font-size: 16px; min-height: var(--safe-tap); display: flex; align-items: center;
  background: transparent; border: 0; text-align: left; cursor: pointer; width: 100%;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav .user { color: #94a3b8; font-size: 13px; padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px; display: block; }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 48;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

@media (min-width: 768px) {
  .hamburger { display: none; }
  .nav-backdrop { display: none; }
  .nav {
    position: static; transform: none;
    flex-direction: row; align-items: center; flex-wrap: nowrap;
    width: auto; max-width: none; padding: 0; background: transparent; box-shadow: none;
    gap: 2px;
  }
  .nav a, .nav button {
    width: auto; min-height: auto; padding: 7px 11px;
    font-size: 14px; font-weight: 600; white-space: nowrap;
    margin: 0 !important;
  }
  .nav .user {
    border: 0; margin: 0; padding: 0 10px;
    font-size: 13px; white-space: nowrap;
    display: flex; align-items: center;
  }
  .nav .btn-ghost { padding: 7px 11px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; min-height: var(--safe-tap); border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px;
  background: transparent; transition: transform .1s, background .15s, box-shadow .15s;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.15); }
.btn:active { transform: scale(.97); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 10px; min-height: 36px; font-size: 13px; }
.btn-icon { padding: 0; width: var(--safe-tap); height: var(--safe-tap); }
.btn-bid {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 50%, #7f1d1d 100%);
  color: #fff; border: 1px solid #5a0000;
  box-shadow: 0 2px 4px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.4);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.btn-bid:hover { background: linear-gradient(180deg, #f87171 0%, #dc2626 50%, #991b1b 100%); }

.btn-buy-own {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 50%, #14532d 100%);
  color: #fff; border: 1px solid #0a3d1f;
  box-shadow: 0 2px 4px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.4);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  font-weight: 700;
}
.btn-buy-own:hover { background: linear-gradient(180deg, #4ade80 0%, #16a34a 50%, #15803d 100%); }

/* ===== Forms ===== */
.form-grid { display: grid; gap: 14px; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #334155; }
.input, .textarea, .select {
  width: 100%; padding: 12px; min-height: var(--safe-tap);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 16px; /* prevent iOS zoom */
  background: #fff; color: var(--text);
  font-family: inherit;
}
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary);
}
.textarea { min-height: 100px; resize: vertical; }

/* ===== Hero ===== */
.hero {
  background:
    url('../../assets/img/hero/hero-wide-diverse-users.jpg') center/cover no-repeat;
  color: #fff; text-align: center;
  min-height: 70vh;
  display: flex; align-items: center;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--page-bg, rgba(14,165,233,.85));
  opacity: .85;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.site-logo { height: 36px; vertical-align: middle; }

.hero h1 { font-size: clamp(24px, 5vw, 36px); margin: 0 0 10px; }
.hero p { opacity: .9; margin: 0 0 20px; font-size: clamp(14px, 2.2vw, 16px); }
.search {
  display: flex; gap: 8px; max-width: 520px; margin: 0 auto;
  flex-direction: column;
}
@media (min-width: 480px) { .search { flex-direction: row; } .search .input { flex: 1; } }

/* ===== Sections / cards ===== */
.section { padding: 24px 0; }
@media (min-width: 768px) { .section { padding: 32px 0; } }

.section-block {
  background: transparent; border: 0; border-radius: 0;
  margin-bottom: 28px; box-shadow: none; overflow: visible;
  position: relative;
}
.section-header {
  display: flex; align-items: center; gap: 12px; padding: 6px 4px 14px;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.section-title-wrap { flex: 1; min-width: 0; }
.section-header h2 {
  margin: 0; font-size: 30px; font-weight: 900; color: var(--text, #0f172a);
  letter-spacing: -.01em; line-height: 1.15;
}
.section-header .subtitle,
.catalogo-header .subtitle {
  display: inline-block; font-size: 16px; color: #475569; font-weight: 500; margin-top: 2px;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,.55),
    1px  1px 0 rgba(255,255,255,.55);
}
.section-viewall {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; background: #fff; color: #0f172a;
  border: 1px solid rgba(15,23,42,.12); border-radius: 10px;
  font-weight: 700; font-size: 14px; text-decoration: none;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
  transition: transform .15s, box-shadow .15s;
}
.section-viewall:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15,23,42,.12); text-decoration: none; }
.section-viewall svg { color: #0f172a; }
.section-toggle {
  width: 42px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid rgba(15,23,42,.12); border-radius: 10px;
  cursor: pointer; color: #0f172a;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
  transition: transform .15s, box-shadow .15s;
}
.section-toggle svg { transition: transform .25s ease; }
.section-toggle.expanded svg { transform: rotate(90deg); }
.section-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15,23,42,.12); }
.section-body { padding: 4px 0 0; }
.section-body.collapsed { display: none; }

/* Drag handle */
.drag-handle {
  width: 42px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid rgba(15,23,42,.12); border-radius: 10px;
  cursor: grab; touch-action: none; user-select: none;
  box-shadow: 0 2px 6px rgba(15,23,42,.08);
  flex-shrink: 0;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.drag-handle:hover { background: #f0f9ff; box-shadow: 0 4px 12px rgba(14,165,233,.2); transform: scale(1.08); }
.drag-handle:active { cursor: grabbing; }

.section-block { transition: transform .18s cubic-bezier(.34,1.56,.64,1), opacity .18s ease; }
.section-block.dragging { opacity: .3; transform: scale(.97); pointer-events: none; }
.section-block.shift-down { transform: translateY(6px); }
.section-block.shift-up   { transform: translateY(-6px); }

.drag-ghost {
  position: fixed; z-index: 9999; pointer-events: none;
  border-radius: 14px; background: #fff;
  box-shadow: 0 24px 64px rgba(14,165,233,.28), 0 8px 24px rgba(14,165,233,.18);
  border: 2px solid rgba(14,165,233,.45);
  transform: rotate(1.5deg) scale(1.03);
  overflow: hidden;
}
.drop-indicator {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  margin: 2px 0;
  box-shadow: 0 0 12px rgba(14,165,233,.55);
  position: relative;
}
.drop-indicator::before, .drop-indicator::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: #0ea5e9; box-shadow: 0 0 8px rgba(14,165,233,.8);
}
.drop-indicator::before { left: -5px; }
.drop-indicator::after  { right: -5px; }

/* ===== Card grid ===== */
.card-grid {
  display: grid; 
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  _padding: 0% 3% 0% 3%;
  /* 96% del ANCHO REAL DE LA PANTALLA (vw), centrado — independiente de cuántos
     contenedores anidados (.container, .catalogo-grid, etc.) haya por encima.
     La técnica margin:calc(50% - 48vw) "rompe" el ancho heredado del padre y
     posiciona el bloque respecto al viewport real, no respecto al padre. */
  _width: 96vw;
  _max-width: 96vw;
  _margin-left: calc(50% - 48vw);
  _margin-right: calc(50% - 48vw);
}
@media (min-width: 640px) { .card-grid { _gap: 12px; } }
@media (max-width: 640px) { .card-grid { padding: 0% 3% 0% 3%; } }

.card {
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px -6px rgba(15,23,42,.18);
  display: flex; flex-direction: column;
  transition: box-shadow 500ms ease;
  color: inherit; position: relative;
}
.card:hover {
  box-shadow:
    0 12px 28px -8px rgba(15,23,42,.28),
    0 24px 48px -16px rgba(15,23,42,.16),
    0 0 0 1px rgba(14,165,233,.12);
  text-decoration: none;
}
.card .card-link { color: inherit; display: block; }
.card .card-link:hover { text-decoration: none; }

/* image wrapper takes white area at the top of the card */
.card .carousel { background: #ffffff; aspect-ratio: 4/3; }

.card .body { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title {
  font-weight: 600; font-size: 15px; line-height: 1.3;
  min-height: 40px; color: #1f2937; margin-bottom: 2px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

.card .price-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 2px 2px 0;
}
.card .price-actual {
  font-weight: 800; font-size: 30px; color: #ef4444; line-height: 1;
}
.card .price-inicial {
  font-size: 16px; font-weight: 500;
  color: rgba(100,116,139,.6);
  text-decoration: line-through;
}

.card .info-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #475569;
}
.card .info-row .url-btn {
  background: transparent; border: 0; color: #475569; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
}
.card .info-row .url-btn:hover { color: #1e3a8a; }

.card .actions-row {
  display: flex; align-items: center; gap: 8px; padding: 0 2px;
}
.card .preg-btn {
  flex: 1; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 12px; color: #334155; padding: 6px 8px; border-radius: 6px;
}
.card .preg-btn:hover { background: rgba(0,0,0,.05); }

.pct-group { display: inline-flex; align-items: stretch; }
.pct-group .pct {
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 4px 8px; border: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.pct-group .pct.left  { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.pct-group .pct.right { border-top-right-radius: 999px; border-bottom-right-radius: 999px; margin-left: 1px; }
.pct.green {
  background: linear-gradient(160deg, #4ade80 0%, #16a34a 45%, #15803d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    1px 2px 0 #14532d,
    0 3px 6px rgba(22,163,74,.45);
}
.pct.yellow {
  background: linear-gradient(160deg, #fef08a 0%, #eab308 45%, #ca8a04 100%);
  color: #1f2937; text-shadow: 0 1px 0 rgba(255,255,255,.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -1px 0 rgba(0,0,0,.15),
    1px 2px 0 #854d0e,
    0 3px 6px rgba(234,179,8,.4);
}
.pct.orange {
  background: linear-gradient(160deg, #fb923c 0%, #f97316 45%, #ea6c0a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    1px 2px 0 #7c2d12,
    0 3px 6px rgba(249,115,22,.45);
}
.pct.red {
  background: linear-gradient(160deg, #f87171 0%, #ef4444 45%, #dc2626 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    1px 2px 0 #7f1d1d,
    0 3px 6px rgba(239,68,68,.45);
}

.card .bid-area {
  margin: 4px 12px 12px; padding: 8px;
  border: 1px solid var(--bid-border); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(255,255,255,.35);
}

/* ===== Carousel ===== */
.carousel {
  position: relative; width: 100%; aspect-ratio: 4/3; background: #f1f5f9;
  overflow: hidden; touch-action: pan-y;
}
.carousel-slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity 1s ease, transform 500ms ease;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  transform: scale(1);
  will-change: transform;
}
.carousel-slide.active {
  opacity: 1;
  border-radius: 3%;
  margin: 20px;
}
.card:hover .carousel-slide.active { transform: scale(1.07); }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.85); color: #111; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; z-index: 2; opacity: 0; transition: opacity .2s;
}
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn.prev { left: 8px; } .carousel-btn.next { right: 8px; }
.carousel-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); border: 0; cursor: pointer; padding: 0; transition: width .2s; }
.carousel-dot.active { background: var(--primary); width: 18px; border-radius: 4px; }

/* ===== Modal / Popup ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 16px; animation: fadeIn .2s;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 520px; width: 100%;
  max-height: 90dvh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .25s;
}
.modal-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close { background: transparent; border: 0; font-size: 24px; cursor: pointer; width: 36px; height: 36px; }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 480px) {
  .modal { max-height: 100dvh; border-radius: var(--radius) var(--radius) 0 0; align-self: flex-end; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
}

/* ===== Auth ===== */
.auth-wrap { max-width: 420px; margin: 40px auto; background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-wrap h1 { margin: 0 0 18px; font-size: 22px; }
.tab-row { display: flex; gap: 0; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab-row button { flex: 1; padding: 12px; min-height: var(--safe-tap); background: transparent; border: 0; cursor: pointer; font-weight: 600; color: var(--text-muted); font-size: 14px; }
.tab-row button.active { color: var(--primary-dark); border-bottom: 2px solid var(--primary); }

/* ===== Tables (responsive) ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-width: 480px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.table th { background: var(--surface-alt); font-weight: 700; }

/* ===== Footer ===== */
.footer {
  background:
    url('../../assets/img/hero/hero-wide-diverse-users.jpg') center/cover no-repeat;
  color: #0f172a; padding: 32px 0 0; margin-top: 40px; font-size: 14px;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--page-bg, rgba(14,165,233,.85));
  opacity: .92;
  z-index: 0;
}
.footer > *, .footer-inner { position: relative; z-index: 1; }
.footer a { color: #b91c1c; text-decoration: none; }
.footer a:hover { text-decoration: underline; color: #b91c1c; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-top {
  text-align: center; padding: 8px 0 24px;
  border-bottom: 1px solid rgba(15,23,42,.18);
}
.footer-user { margin: 0 0 8px; font-weight: 700; color: #0f172a; }
.footer-time-label { margin: 0 0 6px; color: #334155; }
.footer-time { margin: 0; font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -.01em; }
.footer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  padding: 28px 0;
}
.footer-col h4 { margin: 0 0 14px; font-size: 16px; font-weight: 800; color: #0f172a; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-logo { width: 36px; height: 36px; object-fit: contain; }
.footer-brand-name { font-size: 22px; font-weight: 800; color: #0f172a; }
.footer-tag { color: #b91c1c; line-height: 1.5; margin: 0 0 14px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #0f172a;
  border: 1.5px solid rgba(15,23,42,.45);
  transition: background .15s, transform .15s;
}
.footer-social a:hover { background: rgba(15,23,42,.06); text-decoration: none; transform: translateY(-1px); }
.footer-contact-row { display: inline-flex; align-items: center; gap: 8px; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-top: 1px solid rgba(15,23,42,.18);
  padding: 18px 0 28px; color: #334155;
}
.footer-legal { display: flex; gap: 22px; flex-wrap: wrap; }
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-time { font-size: 17px; }
}

/* ===== Admin Backend section ===== */
.admin-backend { background: #000; padding: 36px 0 44px; margin: 0; }
.admin-backend .ab-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.ab-title { margin: 0; text-align: center; color: #9ca3af; font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.ab-subtitle { margin: 6px 0 28px; text-align: center; color: #ef4444; font-size: 16px; font-weight: 600; }
.ab-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 18px;
}
.ab-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 28px 14px;
  background: #b8f5e3; color: #0f172a;
  border-radius: 18px; text-decoration: none;
  min-height: 140px;
  transition: transform .15s, box-shadow .15s;
}
.ab-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.45); text-decoration: none; color: #0f172a; }
.ab-ico {
  width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.35); border-radius: 12px;
  color: #dc2626;
}
.ab-ico svg { width: 28px; height: 28px; }
.ab-lbl { font-size: 15px; font-weight: 700; color: #0f172a; text-align: center; }
@media (max-width: 1100px) { .ab-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px)  { .ab-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px)  { .ab-grid { grid-template-columns: 1fr; } }

/* ===== Toasts ===== */
#toast-host { position: fixed; right: 12px; bottom: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
@media (min-width: 480px) { #toast-host { left: auto; max-width: 360px; } }
.toast { background: #1e293b; color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: slideUp .25s; pointer-events: auto; }
.toast-success { background: var(--success); }
.toast-danger  { background: var(--danger); }
.toast.out { opacity: 0; transition: opacity .25s; }

/* ===== Product detail ===== */
.detail-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .detail-grid { grid-template-columns: 1.1fr 1fr; gap: 32px; } }
.detail-grid .carousel { border-radius: var(--radius); border: 1px solid var(--border); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; font-weight: 600; }

/* ===== Multi-image uploader ===== */
.uploader { border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: background .15s; }
.uploader.drag-over { background: #f0f9ff; border-color: var(--primary); }
.image-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.image-preview { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.image-preview button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.7); color:#fff; border:0; width:24px; height:24px; border-radius:50%; cursor:pointer; }

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { aspect-ratio: 3/4; }

/* ===== Scroll-to-top ===== */
#scroll-top {
  position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px;
  border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(145deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 4px 0 #0369a1,
    0 6px 16px rgba(14,165,233,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .2s, box-shadow .2s;
  z-index: 40; display: flex; align-items: center; justify-content: center;
}
#scroll-top.show { opacity: 1; pointer-events: auto; }
#scroll-top:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 6px 0 #0369a1,
    0 10px 24px rgba(14,165,233,.55);
}
#scroll-top:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.3),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 2px 0 #0369a1,
    0 4px 10px rgba(14,165,233,.4);
}

/* Social icons in footer */
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.social-fb {
  color: #fff;
  background: linear-gradient(145deg, #5b8af0 0%, #1877f2 45%, #1258c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 3px 0 #0d47a1,
    0 5px 12px rgba(24,119,242,.45);
}
.social-ig {
  color: #fff;
  background: linear-gradient(145deg, #f77737 0%, #c13584 50%, #833ab4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.3),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 3px 0 #6a1b9a,
    0 5px 12px rgba(193,53,132,.45);
}
.social-link:hover { transform: translateY(-3px) scale(1.08); text-decoration: none; }
.social-fb:hover  { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 0 #0d47a1, 0 10px 20px rgba(24,119,242,.5); }
.social-ig:hover  { box-shadow: inset 0 1px 0 rgba(255,255,255,.3),  0 6px 0 #6a1b9a, 0 10px 20px rgba(193,53,132,.5); }

/* ===== Q&A list ===== */
.qa-item { padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: var(--surface-alt); }
.qa-item .q { font-weight: 600; }
.qa-item .a { color: var(--text-muted); margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--primary); }

/* Star rating */
.stars { color: #fbbf24; font-size: 18px; letter-spacing: 2px; }
.stars-input button { background: transparent; border: 0; cursor: pointer; font-size: 28px; color: #cbd5e1; padding: 0 2px; }
.stars-input button.active { color: #fbbf24; }

/* ===== Hero actions ===== */
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 18px;
}
.btn-lg { padding: 12px 22px; font-size: 15px; min-height: 48px; }
.btn-accent { background: var(--accent); color: #1f2937; }
.btn-accent:hover { background: #d97706; color: #fff; }
.btn-ghost-light {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(4px);
}
.btn-ghost-light:hover { background: rgba(255,255,255,.22); }

/* ===== Card extras: badges, icons ===== */
.card-badges-top {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.card-badge-time {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(160deg, #fb923c 0%, #f97316 45%, #ea6c0a 100%);
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -1px 0 rgba(0,0,0,.25),
    1px 2px 0 #7c2d12,
    0 4px 8px rgba(249,115,22,.45);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.card-badge-time.expired {
  background: linear-gradient(160deg, #f87171 0%, #ef4444 45%, #dc2626 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.25),
    1px 2px 0 #7f1d1d,
    0 4px 8px rgba(239,68,68,.45);
}

.card-badges-top .badge {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: none; text-shadow: 0 1px 1px rgba(0,0,0,.15);
}
.badge-tipo.badge-subasta,
.badge-estado,
.badge-est-usado {
  background: linear-gradient(160deg, #fef08a 0%, #fde047 45%, #eab308 100%);
  color: #713f12;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.15),
    1px 2px 0 #92400e,
    0 4px 8px rgba(234,179,8,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.badge-tipo.badge-venta {
  background: linear-gradient(160deg, #d9f99d 0%, #bef264 45%, #a3e635 100%);
  color: #365314;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.15),
    1px 2px 0 #3f6212,
    0 4px 8px rgba(163,230,53,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.badge-est-nuevo {
  background: linear-gradient(160deg, #bbf7d0 0%, #86efac 45%, #4ade80 100%);
  color: #14532d;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.15),
    1px 2px 0 #166534,
    0 4px 8px rgba(74,222,128,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.badge-est-reacondicionado {
  background: linear-gradient(160deg, #ddd6fe 0%, #c4b5fd 45%, #a78bfa 100%);
  color: #4c1d95;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(0,0,0,.2),
    1px 2px 0 #5b21b6,
    0 4px 8px rgba(167,139,250,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* Heart fav button: floating bottom-right of image */
.card-fav {
  position: absolute; right: 10px; top: calc(75% * (3/4) + 10px);
  /* fallback positioning handled via JS-free trick: place inside image wrapper */
}
.image-wrap { position: relative; }
.image-wrap .card-fav {
  position: absolute; right: 10px; bottom: 10px; top: auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.95); border: 1px solid #e2e8f0;
  color: #475569; cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 4;
  transition: transform .15s, background .15s, color .15s;
}
.image-wrap .card-fav:hover { transform: scale(1.08); }
.image-wrap .card-fav.active { background: #ef4444; color: #fff; border-color: #7f1d1d; }

.card-pcts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge-pct { font-size: 10.5px; padding: 2px 8px; }
.pct-vendedor { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.pct-producto { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* Disabled bid button (logged out) */
.btn-bid-disabled {
  background: #94a3b8; color: #f1f5f9; border: 1px solid #64748b;
  cursor: not-allowed; opacity: .85;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.btn-bid-disabled:hover { background: #94a3b8; }

/* ===== Section "Ver todo" link ===== */
.section-viewall {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: #0f172a;
  padding: 8px 14px; border-radius: 8px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
  white-space: nowrap;
}
.section-viewall:hover { background: #f8fafc; text-decoration: none; }
@media (max-width: 480px) {
  .section-viewall { font-size: 12px; padding: 6px 10px; }
  .section-header h2 { font-size: 18px; }
}

/* ===== Admin Nav ===== */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 24px;
}
.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,.15);
  transition: background .15s, color .15s;
  margin-right: 8px;
}
.admin-back:hover { background: #e2e8f0; color: #0f172a; text-decoration: none; }
.admin-nav a:not(.admin-back) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.admin-nav a:not(.admin-back):hover { background: #e2e8f0; color: #0f172a; }
.admin-nav a:not(.admin-back).active { background: #0f172a; color: #fff; }
.admin-nav a svg { flex-shrink: 0; }

/* ===== Botón Volver global ===== */
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; border: 1px solid #fff;
  margin-bottom: 16px; transition: background .15s, color .15s, box-shadow .15s;
  background: transparent; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-back:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2); }

/* ===== Banner de puja en card ===== */
.bid-banner {
  background: rgba(255,255,255,.75);
  color: var(--text, #0f172a);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  text-align: center;
  letter-spacing: .02em;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

/* ── product.html responsive ─────────────────────────────── */
.product-detail-card {
  background: var(--card-bg, #fff);
  border-radius: 18px;
  padding: 0;
  margin: 8px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* Imagen full-bleed arriba del card, sin padding */
.product-carousel-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f1f5f9;
}
.product-carousel-wrap .carousel {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  min-height: unset !important;
  max-height: unset !important;
}
/* Info section con padding */
.product-info { display: flex; flex-direction: column; gap: 10px; padding: clamp(14px,4vw,24px); }
.product-title {
  margin: 6px 0 0;
  font-size: clamp(18px, 4vw, 28px);
  line-height: 1.25;
  color: var(--text, #0f172a);
}
.product-desc {
  color: #475569;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.product-meta { font-size: 14px; margin: 0; color: var(--text, #0f172a); }
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.product-price-row .price-actual {
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 800;
  color: #ef4444;
  line-height: 1;
}
.product-price-row .price-inicial {
  font-size: 16px;
  font-weight: 500;
  color: rgba(100,116,139,.6);
  text-decoration: line-through;
}
.product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.product-btn-main { flex: 1; min-width: 130px; }
.product-section-title { margin: 20px 0 10px; font-size: 16px; }

/* ── product.html: layout de 2 columnas + márgenes de página 3% ── */
/* El <main> de product.html ocupa todo el ancho para que el 3% sea respecto a la pantalla */
.product-main-full {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.product-detail-2col {
  margin-left: 3%;
  margin-right: 3%;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  overflow: visible;
  background: #ffffff44;
  border-radius: 30px;
}
@media (min-width: 768px) {
  .product-detail-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
    padding: clamp(16px, 2.5vw, 28px);
  }
  /* En 2 columnas el carrusel ya no es full-bleed: recupera esquinas redondeadas */
  .product-detail-2col .product-carousel-wrap {
    border-radius: 14px;
    overflow: hidden;
  }
  .product-detail-2col .product-info { padding: 0; }
}
/* Columna izquierda: separación entre título, badge y carrusel */
.product-col-left { display: flex; flex-direction: column; gap: 10px; }
.product-col-left .badge { align-self: flex-start; }
.product-col-left .product-title { margin: 0; }
/* Columna derecha */
.product-col-right {
  border-radius: 14px;
  padding: clamp(14px, 3vw, 22px);
  box-sizing: border-box;
}

/* Mobile: una sola columna (el grid no aplica < 768px, todo se apila) */
@media (max-width: 767px) {
  .product-detail-2col { margin-left: 3%; margin-right: 3%; }
  .product-detail-2col .product-info { padding: 0; }
  .product-col-left .badge,
  .product-col-left .product-title { padding: 0 2px; }
}

@media (max-width: 640px) {
  .product-detail-card { border-radius: 12px; }
  .product-carousel-wrap { aspect-ratio: 4/3; }
  .product-actions .btn { font-size: 13px; padding: 9px 12px; }
  .table th, .table td { font-size: 12px; padding: 6px 8px; }
}

/* ===== Mini calendario inline (modal de puja) ===== */
.mini-calendar {
  border: 2px solid var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 7px;
  background: #fff;
  user-select: none;
}
.mc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.mc-title { font-weight: 700; font-size: 13px; color: var(--text, #0f172a); text-transform: lowercase; }
.mc-nav {
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; line-height: 1; color: #475569; padding: 2px 6px; border-radius: 5px;
}
.mc-nav:hover { background: #f1f5f9; }
.mc-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 9px; color: #94a3b8; text-align: center; margin-bottom: 2px;
}
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mc-day {
  /* Altura fija (en vez de aspect-ratio:1) para reducir el alto total del calendario a la mitad */
  height: 24px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 50%;
  font-size: 12px; color: var(--text, #0f172a); cursor: pointer;
}
.mc-day:not(.mc-disabled):not(.mc-out):hover { background: #f1f5f9; }
.mc-day.mc-out { color: #cbd5e1; cursor: default; }
.mc-day.mc-disabled { color: #cbd5e1; cursor: not-allowed; }
.mc-day.mc-today { box-shadow: inset 0 0 0 1.5px #0ea5e9; font-weight: 700; }
.mc-day.mc-selected { background: #dc2626; color: #fff; font-weight: 700; }
.mc-footer {
  display: flex; justify-content: space-between; margin-top: 5px;
  padding-top: 4px; border-top: 1px solid var(--border, #e2e8f0);
}
.mc-link {
  border: none; background: transparent; cursor: pointer;
  color: #2563eb; font-size: 11px; font-weight: 600; padding: 2px 5px;
}
.mc-link:hover { text-decoration: underline; }

#bid-amount-input {
    font-size: 30px;
}

