/* ==================== ESTILOS DEL MODAL DE PRODUCTO ==================== */

/* --- Animaciones --- */

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes modalSlideUpExit {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

/* --- Cuerpo del Producto --- */

.producto-detalle {
    max-height: 65vh; /* Un poco más de espacio vertical */
    overflow-y: auto;
    padding: 0 5px;   /* Evita que el scrollbar pegue con el contenido */
    scrollbar-width: thin; /* Scrollbar elegante en Firefox */
}

/* Imagen del Modal */
.producto-detalle-img {
    width: 100%;
    height: 300px; /* Altura fija para consistencia */
    border-radius: var(--radius);
    margin-bottom: 20px;
    object-fit: cover;
    display: block;
    box-shadow: var(--shadow);
}

.producto-detalle-descripcion {
    color: var(--gray);
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 14px;
}

/* --- Sección de Precios --- */

.precio-base {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.precio-base span {
    font-weight: 500;
    color: var(--dark);
}

.precio-base strong {
    color: var(--primary); /* Usamos el color oscuro principal */
    font-size: 20px;
    font-weight: 800;
}

/* --- Footer del Modal (Total + Botón) --- */

.modal-footer .precio-total {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.precio-total span {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.precio-total strong {
    font-size: 24px;
    color: var(--primary);
    font-weight: 800;
    line-height: 1;
}

.modal-footer .btn {
    flex: 1.5; /* El botón ocupa más espacio que el precio */
    width: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--secondary); /* Amarillo marca */
    color: var(--black);
    font-weight: 700;
    box-shadow: var(--shadow);
}

.modal-footer .btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

/* --- Sección de Extras --- */

.extras-seccion {
    margin-bottom: 30px;
}

.extras-seccion h4 {
    margin-bottom: 5px;
    color: var(--dark);
    font-size: 16px;
    font-weight: 700;
}

.extras-help {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 15px;
    display: block;
}

.extras-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Item Extra (Grid Layout) */
.extra-item-with-qty {
    display: grid;
    /* Checkbox | Nombre | Precio | Controles */
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.extra-item-with-qty:hover {
    border-color: var(--secondary);
    background: #fffdf5; /* Fondo amarillo muy sutil */
    transform: translateX(5px);
}

/* Checkbox personalizado (si usas el nativo, esto lo alinea bien) */
.extra-item-with-qty input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--secondary); /* El check se pone amarillo */
}

.extra-nombre {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.extra-precio {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* --- Controles de Cantidad (+ / -) --- */

.cantidad-controles {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 20px; /* Más redondeado */
    padding: 2px;
    /* min-width eliminado para que se ajuste al contenido */
}

.cantidad-controles button {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--light); /* Fondo neutro */
    color: var(--dark);
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%; /* Botones redondos */
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cantidad-controles button:hover:not(:disabled) {
    background: var(--dark);
    color: var(--white);
}

.cantidad-controles button:disabled {
    background: transparent;
    color: #ccc;
    cursor: not-allowed;
}

.cantidad-controles .cantidad-valor {
    width: 30px;
    text-align: center;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    background: transparent;
    padding: 0;
}

/* Input spinners removal */
.cantidad-controles .cantidad-valor::-webkit-outer-spin-button,
.cantidad-controles .cantidad-valor::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Input Cantidad General (Si existe fuera de extras) --- */
.cantidad-seccion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 480px) {
    .producto-detalle-img {
        height: 200px; /* Menos altura en móvil */
    }

    .modal-footer {
        gap: 15px;
        padding: 15px;
    }
    
    .precio-total strong {
        font-size: 20px;
    }

    /* Ajuste del Grid en móviles muy pequeños */
    .extra-item-with-qty {
        gap: 10px;
        padding: 10px;
        grid-template-columns: auto 1fr auto; /* Ocultamos controles o ajustamos */
    }

    /* En móvil, movemos los controles a una nueva fila si no caben, 
       o ajustamos el layout. Aquí mantenemos layout pero ajustamos tamaños */
    
    .extra-item-with-qty {
        /* Checkbox | Nombre | Precio */
        /* Controles abajo */
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .extra-item-with-qty input[type="checkbox"] {
        margin-right: 8px;
    }

    .extra-nombre {
        flex: 1; /* Toma el espacio disponible */
        min-width: 120px;
    }

    .extra-precio {
        margin-right: 10px;
    }

    .cantidad-controles {
        margin-left: auto; /* Empuja los controles a la derecha */
        margin-top: 5px; /* Pequeña separación si baja de línea */
    }
}

/* ==================== NOTA DEL PRODUCTO ==================== */

.nota-producto-seccion {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.nota-producto-seccion label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 15px;
}

.nota-producto-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
    min-height: 60px;
    max-height: 150px;
    font-family: inherit;
}

.nota-producto-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}