/* ===================== */
/* Botón agregar al carrito */
/* ===================== */
.btn-agregar {
    font-family: inherit;
    background: #f8c11b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    font-size: 0.9rem;
}

.btn-agregar:hover {
    background: #d9a30f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-agregar:active {
    transform: translateY(0);
}

.btn-agregar i {
    font-size: 1rem;
}

/* ===================== */
/* Notificación carrito */
/* ===================== */
.notificacion-carrito {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease-out;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #27ae60;
    max-width: 90%;
    line-height: 1.5;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .notificacion-carrito {
        width: 90%;
        max-width: 400px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ===================== */
/* Modal carrito unificado */
/* ===================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Evitar scroll en el body cuando el modal está abierto */
body.modal-abierto {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.modal.mostrar {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    opacity: 1;
}

.modal-contenido {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    margin: auto 0;
}

.modal.mostrar .modal-contenido {
    transform: translateY(0);
}

.modal-encabezado {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-encabezado h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.cerrar-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: #777;
    line-height: 1;
    padding: 0 10px;
}

.cerrar-modal:hover {
    color: #333;
}

.modal-cuerpo {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(90vh - 150px);
    -webkit-overflow-scrolling: touch;
}

.modal-encabezado h2,
.carrito-item-titulo,
.carrito-item-precio {
    font-family: inherit;
}

.modal-pie {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* ===================== */
/* Botones del modal */
/* ===================== */
.btn-carrito {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.9rem;
}

.btn-carrito:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primario {
    background-color: #e74c3c;
    color: white;
}

.btn-primario:hover {
    background-color: #c0392b;
}

.btn-secundario {
    background-color: #f0f0f0;
    color: #333;
    margin-right: 10px;
}

.btn-secundario:hover {
    background-color: #e0e0e0;
}

/* ===================== */
/* Carrito items */
/* ===================== */
.carrito-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    align-items: flex-start;
}

.carrito-item:last-child {
    border-bottom: none;
}

.carrito-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.carrito-item-info {
    display: flex;
    flex-direction: column;
    padding-right: 30px;
    text-align: left;
}

.carrito-item-titulo {
    font-size: 1rem;
    margin: 0 0 6px 0;
    font-weight: 500;
    line-height: 1.3;
}

.carrito-item-precio {
    font-size: 1rem;
    font-weight: 600;
    color: #e74c3c;
    margin: 4px 0 8px 0;
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
}

.cantidad-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.cantidad-texto {
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
}

.eliminar-item {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.4rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.eliminar-item:hover {
    opacity: 1;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 10px 0;
}

.carrito-total-precio {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.3rem;
}

.carrito-vacio {
    text-align: center;
    padding: 20px;
}

.carrito-acciones {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.carrito-acciones .btn-primario {
    margin-left: auto;
}

/* ===================== */
/* Opciones de entrega */
/* ===================== */
.opciones-entrega {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.opciones-entrega h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.opcion-entrega {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.opcion-entrega label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
}

/* ===================== */
/* Opciones de bebidas */
/* ===================== */
#opciones-bebidas {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.opcion-bebida {
    margin-bottom: 15px;
}

.opcion-bebida h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #555;
}

.opciones-temperatura {
    display: flex;
    gap: 15px;
}

.opcion-temperatura {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===================== */
/* Responsivo */
/* ===================== */
@media (max-width: 768px) {
    .modal.mostrar {
        padding: 0;
        align-items: flex-end;
    }

    .modal-contenido {
        width: 100%;
        margin: 0;
        border-radius: 12px 12px 0 0;
    }

    .opcion-entrega {
        flex-direction: column;
        gap: 10px;
    }

    .opciones-temperatura {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .modal-contenido {
        width: 95%;
    }

    .carrito-acciones {
        flex-direction: column;
        gap: 8px;
    }

    .btn-carrito {
        width: 100%;
    }
}


/* Estilos para mensajes de error */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.form-control.error {
    border-color: #e74c3c;
}

.form-group {
    margin-bottom: 1rem;
}