/* Estilos para el carrito - Inspirado en WooCommerce */

/* Botón flotante para el carrito */
#carrito-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.carrito-icono {
    width: 50px;
    height: 50px;
    background-color: var(--color-principal);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.carrito-icono svg {
    width: 25px;
    height: 25px;
    color: white;
}

#carrito-contador {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: white;
    color: var(--color-principal);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--color-principal);
}

/* Estilos para el contador del carrito en la barra de navegación */
#carrito-contador-nav {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-principal);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para la página del carrito */
/* Nota: contenedor-logo y logo se heredan de style.css */

.container {
    padding: 0 15px;
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.titulo {
    color: var(--color-principal);
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.btn-volver {
    background-color: #f5f5f5;
    color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    border: 1px solid #ddd;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-volver:hover {
    background-color: #e5e5e5;
}

.carrito-vacio {
    text-align: center;
    padding: 30px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.carrito-item {
    display: flex;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.carrito-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.carrito-item-imagen {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-right: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-nombre {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.carrito-item-codigo {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    padding: 4px 8px;
    border-radius: 3px;
    border-left: 2px solid var(--color-principal);
    display: inline-block;
    font-weight: 500;
}

.carrito-item-precio {
    color: var(--color-principal);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.carrito-item-subtotal {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
}

.carrito-item-cantidad button,
.btn-disminuir,
.btn-aumentar {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carrito-item-cantidad button:hover,
.btn-disminuir:hover,
.btn-aumentar:hover {
    background-color: #e5e5e5;
}

.carrito-item-cantidad input,
.input-cantidad {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    text-align: center;
    margin: 0 5px;
    font-size: 14px;
}

.carrito-item-eliminar {
    background-color: transparent;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.3s ease;
}

.carrito-item-eliminar:hover {
    color: #ff3b30;
}

#carrito-resumen {
    padding: 0;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
    font-size: 18px;
}

/* Notificación del carrito */
#carrito-notificacion {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f7f6f7;
  color: #515151;
  padding: 1em 1.5em;
  border-top: 3px solid #a46497;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  z-index: 9999;
  opacity: 0;
  transition: all 0.5s ease;
  max-width: 300px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

#carrito-notificacion.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#carrito-notificacion.oculto {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  z-index: -1;
}

.carrito-notificacion-contenido {
  display: flex;
  align-items: center;
}

.carrito-notificacion-icono {
  margin-right: 10px;
  fill: #a46497;
}

/* Estilos para el contador del carrito */
.carrito-contador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #a46497;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  position: absolute;
  top: -8px;
  right: -8px;
}

/* Estilos para botones del carrito */
.btn-agregar-carrito {
  background-color: #a46497;
  color: white;
  border: none;
  padding: 0.5em 1em;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-agregar-carrito:hover {
  background-color: #8a4580;
}

.btn-eliminar-carrito {
  color: #a46497;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.btn-eliminar-carrito:hover {
  color: #8a4580;
}

/* Estilos para el resumen del carrito */
.carrito-resumen {
  background-color: #f7f6f7;
  border-radius: 3px;
  padding: 1em;
  margin-bottom: 1em;
}

/* Estilos para la tabla de productos en el carrito */
.carrito-tabla {
  width: 100%;
  border-collapse: collapse;
}

.carrito-tabla th {
  text-align: left;
  padding: 0.5em;
  border-bottom: 1px solid #e2e2e2;
}

.carrito-tabla td {
  padding: 0.5em;
  border-bottom: 1px solid #e2e2e2;
}

.carrito-tabla .producto-imagen {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.carrito-tabla .producto-cantidad {
  width: 60px;
  text-align: center;
}

/* Estilos para el botón de WhatsApp */
.btn-whatsapp,
#btn-whatsapp {
  width: 100%;
  background-color: #25d366;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.btn-whatsapp:hover,
#btn-whatsapp:hover {
  background-color: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Estilos para el botón de WhatsApp deshabilitado */
.btn-whatsapp:disabled,
#btn-whatsapp:disabled {
  background-color: #a8d8b9;
  color: rgba(255, 255, 255, 0.8);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-whatsapp:disabled:hover,
#btn-whatsapp:disabled:hover {
  background-color: #a8d8b9;
  transform: none;
  box-shadow: none;
}

.btn-whatsapp svg,
#btn-whatsapp svg {
  width: 24px;
  height: 24px;
  margin-right: 10px;
}

/* Botones específicos del carrito */
#btn-vaciar {
    width: 100%;
    background-color: #f5f5f5;
    color: #666;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    border: 1px solid #ddd;
    cursor: pointer;
    margin: 15px 0 80px 0;
    transition: all 0.3s ease;
}

#btn-vaciar:hover {
    background-color: #e5e5e5;
    color: #333;
}

/* Estilos para el botón de Cianbox */
.btn-cianbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-cianbox:hover {
    background-color: #3367d6;
}

.btn-cianbox svg {
    margin-right: 8px;
}

/* Pantalla de carga */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}