/**********************************************
* ESTILOS DEL CARRITO (EXTRACCIÓN COMPLETA)
***********************************************/

/* Contenedor principal del carrito */
#carrito-flotante {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* Botón del carrito */
#boton-carrito {
    background: #ff5722;
    color: white;
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Panel del carrito (expandido) */
#panel-carrito {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 350px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    margin-top: 10px;
}

/* Header del carrito */
.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.carrito-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

/* Lista de productos */
#lista-productos {
    padding: 15px;
}

.producto-carrito {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.nombre-producto {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.controles-producto {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botones de cantidad */
.btn-menos, .btn-mas {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-menos {
    color: #ff5722;
    border-color: #ff5722;
}

.btn-mas {
    color: #4CAF50;
    border-color: #4CAF50;
}

.cantidad-producto {
    min-width: 20px;
    text-align: center;
}

.precio-producto {
    margin-left: auto;
    font-weight: bold;
    color: #333;
}

/* Iconos de +/- */
.icon-minus::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff5722"><path d="M19 13H5v-2h14v2z"/></svg>');
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

.icon-plus::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>');
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

/* Botón eliminar */
.btn-eliminar {
    background: none;
    border: none;
    cursor: pointer;
    color: #f44336;
    font-size: 1.2em;
    padding: 5px;
    margin-left: 10px;
}

/* Notas del producto */
.nota-producto {
    display: block;
    width: 96%;
    margin-top: 5px;
    padding: 5px;
    font-size: 0.9em;
    color: #666;
    resize: vertical;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Footer del carrito */
.carrito-footer {
    padding: 15px;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
}

.total-panel {
    text-align: center;
    margin: 10px 0;
    font-size: 16px;
    font-weight: bold;
}

#finalizar-pedido {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background 0.3s;
}

#finalizar-pedido:hover {
    background: #45a049;
}

/**********************************************
* ESTILOS DE MODALES (EXTRACCIÓN DEL JS)
***********************************************/

/* Modal de opciones de envío */
#modal-opciones-envio {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-opciones-envio > div {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

#pdf-status {
    margin: 15px 0;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
}

#pdf-status a {
    color: #1b5e20;
}

#botones-envio {
    margin-top: 20px;
}

#enviar-whatsapp {
    margin: 10px;
    padding: 10px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#enviar-email {
    margin: 10px;
    padding: 10px;
    background: #4285F4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#cerrar-envio {
    margin-top: 20px;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    width: 100%;
    cursor: pointer;
}

/* Modal de pedido */
#modal-pedido {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-pedido > div {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
}

#form-pedido div {
    margin-bottom: 15px;
}

#form-pedido label {
    display: block;
    margin-bottom: 5px;
}

#form-pedido input {
    width: 100%;
    padding: 8px;
}

#cancelar-pedido {
    padding: 8px 15px;
    background: #ccc;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#form-pedido button[type="submit"] {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/**********************************************
* ICONOS DEL CARRITO (USANDO EMOJIS)
***********************************************/

/* Icono de éxito (V verde) */
.icon-success::before {
    content: '✅'; /* Emoji para éxito */
    display: inline-block;
    vertical-align: middle;
    font-size: 1.2em;
    color: #28a745; /* Verde */
}

/* Icono de error (X roja) */
.icon-error::before {
    content: '❌'; /* Emoji para error */
    display: inline-block;
    vertical-align: middle;
    font-size: 1.2em;
    color: #dc3545; /* Rojo */
}

/* Icono de papelera (🗑️) */
.icon-trash::before {
    content: '🗑️'; /* Emoji para papelera */
    display: inline-block;
    vertical-align: middle;
    font-size: 1em;
    color: #f44336; /* Rojo */
    cursor: pointer;
}

/* Spinner (carga) */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(0, 0, 0, 0.1); /* Fondo del spinner */
    border-radius: 50%; /* Forma circular */
    border-top-color: #007bff; /* Color del borde superior */
    animation: spin 1s ease-in-out infinite; /* Animación rotativa */
	background-color: red; /* Para depuración */
    border: 2px solid rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    to {
        transform: rotate(360deg); /* Giro completo */
    }
}

/**********************************************
* RESPONSIVE DESIGN
***********************************************/

@media (max-width: 480px) {
    #carrito-flotante {
        top: 10px;
        right: 10px;
    }
    
    #panel-carrito {
        width: 300px;
        right: 0;
    }
    
    #boton-carrito {
        padding: 10px 15px;
        font-size: 14px;
    }
}