/* ============================================
   MODAL DEL CARRITO - DISEÑO EXACTO DEL BOCETO
   ============================================ */

/* Modal Container */
.carrito-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carrito-modal.active {
  display: flex !important;
  opacity: 1 !important;
  justify-content: flex-end;
}

/* Overlay */
.carrito-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Contenedor del Carrito */
.carrito-contenedor {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: calc(100% - 20px);
  background: white;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  margin: 10px 10px 10px 0;
  border-radius: 16px 0 0 16px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Header */
.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.carrito-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.carrito-cerrar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #000;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrito-cerrar:hover {
  color: #666;
}

/* Contenido */
.carrito-contenido {
  padding: 1.5rem;
}

/* Barra de Envío Gratis */
.envio-gratis-banner {
  margin-bottom: 1.5rem;
}

.envio-texto {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.envio-texto i {
  font-size: 1.25rem;
}

.envio-barra {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
}

.envio-progreso {
  height: 100%;
  background: #5469d4;
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Lista de Productos */
.productos-lista {
  margin-bottom: 1.5rem;
}

/* Producto en el Carrito */
.carrito-producto {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.carrito-producto-imagen {
  width: 100px;
  height: 100px;
}

.carrito-producto-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.carrito-producto-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.carrito-producto-marca {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
}

.carrito-producto-nombre {
  font-size: 1rem;
  font-weight: 400;
  color: #000;
  margin: 0;
  line-height: 1.3;
}

.carrito-producto-precio {
  font-size: 0.875rem;
  color: #000;
}

.carrito-producto-variante {
  font-size: 0.8125rem;
  color: #666;
}

.carrito-producto-controles {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.carrito-cantidad-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f5f5f5;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.carrito-cantidad-box button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.carrito-cantidad-box button:hover {
  color: #666;
}

.carrito-cantidad-box span {
  font-size: 0.9375rem;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.carrito-btn-eliminar {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem;
}

.carrito-btn-eliminar:hover {
  color: #000;
}

.carrito-producto-subtotal {
  font-size: 1rem;
  font-weight: 600;
  color: #000;
}

/* Secciones Expandibles */
.seccion-expandible {
  border-bottom: 1px solid #e5e5e5;
}

.expandible-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #000;
  text-align: left;
}

.expandible-btn:hover {
  color: #666;
}

.expandible-btn i {
  font-size: 1.25rem;
}

.expandible-contenido {
  padding-bottom: 1rem;
}

.instrucciones-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}

.instrucciones-textarea:focus {
  outline: none;
  border-color: #5469d4;
}

.descuento-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.descuento-input:focus {
  outline: none;
  border-color: #5469d4;
}

.descuento-aplicar {
  width: 100%;
  padding: 0.75rem;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.descuento-aplicar:hover {
  background: #e5e5e5;
}

/* Subtotal */
.subtotal-seccion {
  padding: 1.5rem 0;
}

.subtotal-linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.subtotal-texto {
  font-size: 1rem;
  font-weight: 600;
  color: #000;
}

.subtotal-precio {
  font-size: 1.125rem;
  font-weight: 600;
  color: #000;
}

.impuestos-texto {
  font-size: 0.8125rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.envio-link {
  color: #5469d4;
  text-decoration: underline;
}

/* Términos */
.terminos-seccion {
  margin-bottom: 1rem;
}

.terminos-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #000;
  line-height: 1.5;
}

.terminos-label input[type="checkbox"] {
  margin-top: 0.125rem;
  cursor: pointer;
}

.terminos-label a {
  color: #5469d4;
  text-decoration: none;
}

.terminos-label a:hover {
  text-decoration: underline;
}

/* Botón Check-out */
.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: #87cebc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  transition: background 0.2s ease;
}

.btn-checkout:hover:not(.disabled) {
  background: #6fbaa8;
}

.btn-checkout.disabled {
  background: #d0d0d0;
  cursor: not-allowed;
}

/* Botones de Navegación */
.botones-navegacion {
  display: flex;
  gap: 1rem;
}

.btn-seguir,
.btn-ver-carrito {
  flex: 1;
  padding: 0.75rem;
  background: white;
  border: none;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.btn-seguir {
  color: #5469d4;
}

.btn-ver-carrito {
  color: #5469d4;
}

.btn-seguir:hover,
.btn-ver-carrito:hover {
  color: #3d51c4;
}

/* Carrito Vacío */
.carrito-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.carrito-vacio-icon {
  font-size: 4rem;
  color: #e5e5e5;
  margin-bottom: 1rem;
}

.carrito-vacio h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 0.5rem 0;
}

.carrito-vacio p {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0 1.5rem 0;
}

.btn-explorar {
  padding: 0.875rem 1.5rem;
  background: #5469d4;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-explorar:hover {
  background: #3d51c4;
}

/* Badge del carrito */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4757;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Responsive */
@media (max-width: 640px) {
  .carrito-contenedor {
    max-width: 100%;
  }
  
  .producto-card {
    flex-wrap: wrap;
  }
  
  .producto-subtotal {
    width: 100%;
    text-align: left;
    padding-top: 0;
  }
}

/* ============================================
   MODAL DE MARCADORES (BOOKMARKS)
   ============================================ */

.bookmarks-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bookmarks-modal.active {
  display: flex !important;
  opacity: 1 !important;
  justify-content: flex-end;
}

.bookmarks-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.bookmarks-contenedor {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: calc(100% - 20px);
  background: white;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  margin: 10px 10px 10px 0;
  border-radius: 16px 0 0 16px;
  display: flex;
  flex-direction: column;
}

.bookmarks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.bookmarks-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bookmarks-cerrar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #000;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.bookmarks-cerrar:hover {
  background: #f0f0f0;
}

#bookmarks-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

/* Product cards */
.bookmark-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.bookmark-card:last-child {
  border-bottom: none;
}

.bookmark-imagen-link img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #f5f5f5;
}

.bookmark-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.bookmark-nombre {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.bookmark-nombre:hover {
  color: #87cebc;
}

.bookmark-precios {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bookmark-precio {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111;
}

.bookmark-precio-original {
  font-size: 0.75rem;
  color: #999;
  text-decoration: line-through;
}

.bookmark-acciones {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-items: flex-end;
}

.bookmark-btn-ver {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #87cebc;
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.bookmark-btn-ver:hover {
  background: #6ab9a5;
}

.bookmark-btn-quitar {
  background: none;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  color: #999;
  font-size: 0.875rem;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
}

.bookmark-btn-quitar:hover {
  color: #e55;
  border-color: #e55;
}

/* Empty / login states */
.bookmarks-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: #888;
  text-align: center;
}

.bookmarks-vacio-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.bookmarks-vacio p {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #555;
  margin: 0;
}

.bookmarks-vacio span {
  font-size: 0.8125rem;
}

/* Loading state */
.bookmarks-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
  color: #87cebc;
  font-size: 1.5rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bookmarks-error {
  text-align: center;
  color: #e55;
  padding: 1rem;
  font-size: 0.875rem;
}

/* Sin stock badge */
.badge-sin-stock {
  background: #e55;
  color: #fff;
  font-size: 0.6875rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .bookmarks-contenedor {
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    height: 85%;
    margin-top: auto;
  }

  .bookmarks-modal.active {
    align-items: flex-end;
  }

  .bookmark-card {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }

  .bookmark-acciones {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
}

