/* ============================================
   WAVES SURF SHOP — Lista de pedido
   Panel lateral + botón flotante + controles
   ============================================ */

/* --- Botón flotante: reemplaza al WhatsApp suelto --- */
.pedido-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--deep);
  color: var(--white);
  padding: 0.85rem 1.4rem;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: all var(--ease);
  border: none;
  cursor: pointer;
}

.pedido-fab:hover {
  background: var(--ocean);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(10, 126, 164, 0.35);
}

.pedido-fab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pedido-fab-count {
  background: var(--coral);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* --- Contador en el nav --- */
.nav-pedido {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep);
  background: transparent;
  border: 1.5px solid var(--border-mid);
  padding: 0.5rem 1rem;
  border-radius: var(--r-full);
  transition: all var(--ease);
  cursor: pointer;
}

.nav-pedido:hover {
  border-color: var(--ocean);
  color: var(--ocean);
}

.nav-pedido svg { width: 16px; height: 16px; }

.nav-pedido-count {
  background: var(--coral);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* --- Overlay --- */
.pedido-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 48, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease), visibility var(--ease);
  z-index: 190;
}

.pedido-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* --- Panel lateral --- */
.pedido-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.pedido-panel.open { transform: translateX(0); }

.pedido-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pedido-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep);
}

.pedido-head p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.pedido-cerrar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--ease);
  flex-shrink: 0;
}

.pedido-cerrar:hover {
  background: var(--border);
  color: var(--deep);
}

/* --- Lista --- */
.pedido-lista {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.pedido-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pedido-item-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--deep);
  line-height: 1.3;
}

.pedido-item-info span {
  font-size: 0.72rem;
  color: var(--text-light);
}

.pedido-item-cant {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-full);
  overflow: hidden;
}

.pedido-item-cant button {
  width: 30px;
  height: 32px;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: background var(--ease), color var(--ease);
}

.pedido-item-cant button:hover {
  background: var(--ocean-pale);
  color: var(--ocean);
}

.pedido-item-cant input {
  width: 46px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--deep);
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
}

.pedido-item-cant input::-webkit-outer-spin-button,
.pedido-item-cant input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pedido-item-quitar {
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 0.3rem;
  transition: color var(--ease);
}

.pedido-item-quitar:hover { color: var(--coral); }

.pedido-vacio {
  text-align: center;
  padding: 4rem 1rem;
}

.pedido-vacio p {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 0.4rem;
}

.pedido-vacio span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: block;
  max-width: 260px;
  margin: 0 auto;
}

/* --- Pie del panel --- */
.pedido-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.pedido-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pedido-total strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--deep);
}

.pedido-footer .btn { width: 100%; justify-content: center; }

.pedido-acciones {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.pedido-vaciar {
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: underline;
  transition: color var(--ease);
}

.pedido-vaciar:hover { color: var(--coral); }

/* --- Agregar al pedido (cards y ficha) --- */
.btn-agregar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.45rem 0.9rem;
  background: var(--deep);
  color: var(--white);
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background var(--ease), transform var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.btn-agregar:hover {
  background: var(--ocean);
  transform: translateY(-1px);
}

.btn-agregar.agregado {
  background: var(--ocean);
  pointer-events: none;
}

@media (max-width: 768px) {
  .pedido-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.85rem 1.1rem;
  }
  .pedido-fab span.pedido-fab-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pedido-panel { transition: none; }
}

/* `hidden` debe ganarle al display de los badges */
.pedido-fab-count[hidden],
.nav-pedido-count[hidden] { display: none; }

/* El FAB flota sobre la esquina: el pie necesita espacio para no quedar debajo */
.footer-bottom {
  padding-bottom: 3.5rem;
}

@media (max-width: 768px) {
  .footer-bottom { padding-bottom: 4.5rem; }
}
