/* ===== ESTILOS DEL CARRITO Y MODALES =====
   Extiende styles.css sin modificarlo.
   Usa las mismas variables CSS del diseño original.
*/

/* ----- Botón carrito en navbar ----- */
.nav-cart-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Lato', sans-serif;
  transition: background 0.2s;
  position: relative;
}
.nav-cart-btn:hover { background: rgba(255,255,255,0.25); }

.cart-count {
  background: #d4a017;
  color: white;
  border-radius: 50%;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

/* Enlace admin - discreto */
.nav-admin-link {
  font-size: 18px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.nav-admin-link:hover { opacity: 1; }

/* ----- Skeleton loaders ----- */
.skeleton-card {
  height: 340px;
  background: linear-gradient(90deg, #e0ece0 25%, #f0f7f0 50%, #e0ece0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ----- Overlay del carrito ----- */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}
.cart-overlay.open { display: block; }

/* ----- Panel lateral del carrito ----- */
.cart-panel {
  position: fixed; top: 0; right: -420px;
  width: 400px; max-width: 95vw;
  height: 100vh;
  background: #fff;
  z-index: 201;
  display: flex; flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.cart-panel.open { right: 0; }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e0f2ea;
  background: #1a6b4a;
  color: white;
}
.cart-header h3 { font-family: 'Playfair Display', serif; font-size: 20px; }
.cart-close {
  background: none; border: none; color: white;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: background 0.2s;
}
.cart-close:hover { background: rgba(255,255,255,0.2); }

/* ----- Ítems del carrito ----- */
.cart-items {
  flex: 1; overflow-y: auto;
  padding: 16px;
}
.cart-empty {
  text-align: center; color: #888;
  margin-top: 60px; line-height: 1.6;
  font-size: 15px;
}

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f7f0;
}
.cart-item-img {
  width: 56px; height: 56px;
  border-radius: 8px; object-fit: cover;
  flex-shrink: 0;
}
.cart-item-img-placeholder {
  width: 56px; height: 56px;
  border-radius: 8px; background: #e0f2ea;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name {
  font-weight: 700; font-size: 14px; color: #1a2e1a;
}
.cart-item-price { font-size: 13px; color: #557a55; margin-top: 2px; }
.cart-item-controls {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid #d6ebd6; border-radius: 4px;
  background: #f0f7f0; cursor: pointer;
  font-size: 16px; font-weight: 700; color: #1a6b4a;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: #d6ebd6; }
.qty-num { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.cart-item-remove {
  background: none; border: none;
  color: #c0392b; cursor: pointer; font-size: 16px;
  margin-left: auto; padding: 4px;
}

/* ----- Footer del carrito ----- */
.cart-footer {
  padding: 16px 24px;
  border-top: 2px solid #e0f2ea;
  background: #f0f7f0;
}
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 16px;
}
.cart-total strong { font-size: 20px; color: #1a6b4a; }
.btn-checkout {
  width: 100%;
  background: #1a6b4a; color: white;
  border: none; border-radius: 6px;
  padding: 14px; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: 'Lato', sans-serif;
  transition: background 0.2s;
}
.btn-checkout:hover { background: #25996b; }
.btn-checkout:disabled { background: #aaa; cursor: not-allowed; }

/* ----- Modal de checkout ----- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: white; border-radius: 12px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  background: #1a6b4a; color: white;
  border-radius: 12px 12px 0 0;
}
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 20px; }
.modal-header button {
  background: none; border: none; color: white;
  font-size: 20px; cursor: pointer;
}
.modal-body { padding: 24px; }
.modal-subtitle { color: #557a55; margin-bottom: 20px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-weight: 700; font-size: 13px;
  color: #1a2e1a; margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  border: 1px solid #d6ebd6; border-radius: 6px;
  padding: 10px 14px; font-size: 14px;
  font-family: 'Lato', sans-serif;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: #1a6b4a; }

.order-summary {
  background: #f0f7f0; border-radius: 8px;
  padding: 14px; margin-top: 16px;
  font-size: 13px;
}
.order-summary h4 { margin-bottom: 8px; color: #1a6b4a; }
.order-summary ul { list-style: none; padding: 0; }
.order-summary li { padding: 3px 0; border-bottom: 1px solid #e0f2ea; }
.order-summary .summary-total {
  font-weight: 700; margin-top: 8px; color: #1a6b4a; font-size: 15px;
}

.modal-footer {
  display: flex; gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e0f2ea;
}
.btn-cancel {
  flex: 1; padding: 12px;
  border: 1px solid #ddd; border-radius: 6px;
  background: white; cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 14px;
}
.btn-whatsapp {
  flex: 2; padding: 12px;
  background: #25D366; color: white; border: none;
  border-radius: 6px; cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 700;
  transition: background 0.2s;
}
.btn-whatsapp:hover { background: #20b358; }

/* ----- Toast de notificación ----- */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1a6b4a; color: white;
  padding: 14px 20px; border-radius: 6px;
  font-family: 'Lato', sans-serif; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 9999;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}