/* ======================================================
   CUCURUCHO POS - COMPONENTES OPERATIVOS Y MODALES
   ====================================================== */

/* MÉTRICAS Y RESUMEN VENTAS HOY */
.card-ventas {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--shadow-card);
}

.ventas-head {
  font-size: 11px;
  color: var(--c-muted);
  font-weight: 800;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ventas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ventas-grid small {
  display: block;
  font-size: 10px;
  color: var(--c-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.ventas-grid b {
  font-size: 17px;
  color: var(--c-text);
  font-weight: 800;
}

.ventas-grid b span {
  font-size: 10px;
  color: var(--c-green-neto);
  font-weight: 700;
}

/* SECCIÓN DE PRODUCTOS (GRID TÁCTIL) */
.prod-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 14px;
}

.prod-head h2 {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--c-text);
}

.prod-head span {
  font-size: 12px;
  color: var(--c-brand);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

#botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* TARJETA DE PRODUCTO */
.prod-btn {
  height: 110px;
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prod-btn:active {
  transform: scale(0.96);
  border-color: var(--c-brand);
  background-color: #FAF6F2;
}

.prod-btn b {
  font-size: 15px;
  color: var(--c-text);
  display: block;
  font-weight: 800;
  line-height: 1.2;
}

.prod-desc {
  font-size: 10px;
  color: var(--c-muted);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.prod-price {
  color: var(--c-brand);
  font-size: 15px;
  font-weight: 800;
}

.prod-btn::after {
  content: '+';
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
}

/* BARRA FLOTANTE DE CARRITO */
#carrito-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: calc(100% - 24px);
  max-width: 416px;
  background: var(--c-accent-btn);
  color: #FFF;
  border-radius: 18px;
  padding: 12px 16px;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(44, 26, 17, 0.3);
}

.carrito-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 16px;
}

#carritoCount {
  display: block;
  font-size: 11px;
  color: #D2C4B7;
}

#carritoTotalBar {
  font-size: 16px;
  color: #FFF;
  font-weight: 800;
}

.btn-pagar {
  background: #FFF;
  color: var(--c-accent-btn);
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 800;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-pagar:active {
  opacity: 0.9;
}

/* CAJA DE GESTIÓN Y ACCIONES */
.gestion-box {
  margin-top: 24px;
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.btn-cerrar {
  grid-column: 1 / -1;
  background: var(--c-accent-btn);
  color: #FFF;
  border: 0;
  border-radius: 12px;
  padding: 16px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.btn-cerrar:active {
  opacity: 0.92;
}

.btn-ghost {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  border-radius: 12px;
  padding: 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* DETALLE DE VENTAS */
.detalle-ventas {
  margin-top: 20px;
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.detalle-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: var(--c-text);
}

/* Contenedor con altura fija/máxima y scroll interno */
#contenedorLista {
  display: none;
  max-height: 240px;      /* Altura máxima antes de que aparezca la barra de desplazamiento */
  overflow-y: auto;       /* Habilita el scroll vertical */
  scrollbar-width: thin;  /* Estilo de barra fino para navegadores modernos */
}

/* Se muestra cuando está abierto */
#contenedorLista.abierto {
  display: block;
}

#lista .venta-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-muted);
}

#lista .venta-item span:last-child {
  color: var(--c-brand);
  font-weight: 800;
}

/* MODALES Y OVERLAYS */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 26, 17, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  z-index: 100;
}

.modal.open {
  display: grid;
}

.modal-box {
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: 24px;
  padding: 24px;
  width: calc(100% - 32px);
  max-width: 380px;
  box-shadow: var(--shadow-modal);
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pay-btn {
  min-height: 76px;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1.5px solid var(--c-border);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.pay-btn:active {
  transform: scale(0.95);
}