/* ===== CARRITO DE COMPRAS ===== */

/* Botón "Agregar" en cada producto */
.add-cart-btn {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 0;
  align-self: center;
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.15) 0%, rgba(255, 235, 59, 0.05) 100%);
  border: 1px solid rgba(255, 235, 59, 0.4);
  color: #FFEB3B;
  padding: 7px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: 'Helvetica Neue', sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-cart-btn i {
  margin-right: 4px;
}

.add-cart-btn:hover {
  background: rgba(255, 235, 59, 0.3);
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.4);
  transform: scale(1.05);
}

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

/* Botón flotante del carrito */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 1500;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.fab-whatsapp {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.fab-cart {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: -12px;
  background: linear-gradient(135deg, #FFEB3B, #f5b50a);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.cart-fab:hover {
  transform: scale(1.08);
}

body.cart-open .cart-fab {
  display: none;
}

.cart-fab:active {
  transform: scale(0.95);
}

.cart-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 12px;
  background: #FFEB3B;
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #0d0d0d;
}

.cart-fab-bump {
  animation: fabBump 0.35s ease;
}

@keyframes fabBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Fondo oscuro detrás del panel */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1490;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Panel lateral del carrito */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #161616;
  border-left: 1px solid rgba(255, 235, 59, 0.2);
  z-index: 1495;
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-drawer.active {
  right: 0;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 235, 59, 0.2);
}

.cart-drawer-header h2 {
  color: #FFEB3B;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 235, 59, 0.4);
}

.cart-drawer-header h2 i {
  margin-right: 6px;
}

.cart-close {
  background: rgba(255, 255, 255, 0.05);
  color: #FFEB3B;
  border: 1px solid rgba(255, 235, 59, 0.2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.cart-close:hover {
  background: rgba(255, 60, 60, 0.8);
  transform: rotate(90deg);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.cart-item-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.cart-item-unit {
  color: #aaa;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 235, 59, 0.4);
  background: rgba(255, 235, 59, 0.1);
  color: #FFEB3B;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.cart-qty-btn:hover {
  background: rgba(255, 235, 59, 0.25);
}

.cart-qty {
  color: #fff;
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

.cart-item-remove {
  margin-left: auto;
  background: rgba(255, 60, 60, 0.15);
  border: 1px solid rgba(255, 60, 60, 0.35);
  color: #ff5c5c;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s ease;
}

.cart-item-remove:hover {
  background: rgba(255, 60, 60, 0.3);
}

.cart-item-line-total {
  margin-top: 8px;
  color: #FFEB3B;
  font-weight: 700;
  text-align: right;
}

.cart-empty {
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
  display: none;
}

.cart-empty i {
  font-size: 2.5rem;
  color: #FFEB3B;
  margin-bottom: 10px;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 235, 59, 0.2);
  background: #1a1a1a;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cart-total-row span {
  color: #fff;
  font-weight: 700;
}

.cart-total-row .cart-total {
  color: #FFEB3B;
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.cart-clear-btn {
  width: 100%;
  background: rgba(255, 60, 60, 0.12);
  color: #ff5c5c;
  border: 1px solid rgba(255, 60, 60, 0.3);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 8px;
  transition: background 0.2s ease;
}

.cart-clear-btn:hover {
  background: rgba(255, 60, 60, 0.25);
}

.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  padding: 14px;
  font-weight: 800;
  font-size: 1.1rem;
  transition: background 0.3s ease;
}

.cart-checkout-btn:hover {
  background: #128C7E;
}

/* ===== PÁGINA DE PEDIDO (resumen) ===== */

.order-summary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 235, 59, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-qty {
  color: #FFEB3B;
  font-weight: 800;
  flex-shrink: 0;
  min-width: 28px;
}

.order-item-name {
  color: #fff;
  flex: 1;
  font-size: 0.9rem;
}

.order-item-total {
  color: #FFEB3B;
  font-weight: 700;
  white-space: nowrap;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
  margin-bottom: 6px;
}

.order-total-label {
  color: #fff;
  font-weight: 800;
}

.order-total-value {
  color: #FFEB3B;
  font-size: 1.4rem;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.order-empty {
  text-align: center;
  padding: 30px 0;
  display: none;
}

.order-empty p {
  color: #aaa;
  margin-bottom: 14px;
}

.order-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FFEB3B;
  border: 1px solid rgba(255, 235, 59, 0.4);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.order-edit-link:hover {
  background: rgba(255, 235, 59, 0.15);
}

/* Botón para enviar la ubicación actual */
.loc-btn {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.12) 0%, rgba(255, 235, 59, 0.05) 100%);
  border: 1px solid rgba(255, 235, 59, 0.35);
  color: #FFEB3B;
  border-radius: 8px;
  padding: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.loc-btn:hover {
  background: rgba(255, 235, 59, 0.25);
}

.loc-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.loc-status {
  margin-top: 8px;
  font-size: 0.8rem;
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
}

.loc-status.loading {
  display: block;
  color: #FFEB3B;
  background: rgba(255, 235, 59, 0.08);
}

.loc-status.ok {
  display: block;
  color: #5cff8a;
  background: rgba(92, 255, 138, 0.08);
  word-break: break-all;
}

.loc-status.error {
  display: block;
  color: #ff5c5c;
  background: rgba(255, 60, 60, 0.08);
}

.required {
  color: #ff5c5c;
}

@media (max-width: 480px) {
  .add-cart-btn {
    padding: 6px 11px;
    font-size: 0.75rem;
  }

  .cart-fab {
    bottom: 18px;
    right: 14px;
  }

  .fab-whatsapp {
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
  }

  .fab-cart {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .cart-drawer {
    max-width: 100%;
  }
}
